mirror of
https://github.com/kennethreitz-archive/procs.git
synced 2026-06-05 23:30:18 +00:00
Merge pull request #3 from shrayasr/renames
Bunch of renames to follow standard procedures
This commit is contained in:
+4
-4
@@ -13,7 +13,7 @@ Ideas
|
||||
- Process monitoring
|
||||
- programatically compose a chain of streams.
|
||||
- process call timeouts
|
||||
- >>> uptime.std_out >> cowsay.std_in
|
||||
- >>> uptime.stdout >> cowsay.stdin
|
||||
|
||||
Usage
|
||||
-----
|
||||
@@ -23,11 +23,11 @@ Simple Usage::
|
||||
>>> import pipes
|
||||
|
||||
>>> c = pipes.run('uptime')
|
||||
>>> c.exit_code
|
||||
>>> c.returncode
|
||||
0
|
||||
>>> c.ok
|
||||
True
|
||||
>>> print c.std_out
|
||||
>>> print c.stdout
|
||||
16:08 up 1:16, 7 users, load averages: 1.02 1.90 1.75
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ Advanced Usage::
|
||||
>>> chain = pipes.chain()
|
||||
>>> uptime = chain.process('uptime')
|
||||
>>> cowsay = chain.process('cowsay')
|
||||
>>> chain.link(uptime.std_out, cowsay.std_in)
|
||||
>>> chain.link(uptime.stdout, cowsay.stdin)
|
||||
>>> chain.start(wait=True)
|
||||
>>> chain.wait()
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import os
|
||||
import subprocess
|
||||
|
||||
|
||||
|
||||
class Process(object):
|
||||
def __init__(self, command):
|
||||
pass
|
||||
@@ -11,16 +10,16 @@ class Process(object):
|
||||
pass
|
||||
|
||||
@property
|
||||
def std_in(self):
|
||||
return 'std_in'
|
||||
def stdin(self):
|
||||
return 'stdin'
|
||||
|
||||
@property
|
||||
def std_out(self):
|
||||
return 'std_out'
|
||||
def stdout(self):
|
||||
return 'stdout'
|
||||
|
||||
@property
|
||||
def std_err(self):
|
||||
return 'std_err'
|
||||
def stderr(self):
|
||||
return 'stderr'
|
||||
|
||||
|
||||
class Chain(object):
|
||||
@@ -43,11 +42,9 @@ class Chain(object):
|
||||
# wait=wait
|
||||
|
||||
|
||||
|
||||
|
||||
def chain():
|
||||
return Chain()
|
||||
|
||||
|
||||
def process():
|
||||
pass
|
||||
pass
|
||||
|
||||
+3
-3
@@ -5,12 +5,12 @@ chain = pipes.chain()
|
||||
uptime = chain.process('uptime')
|
||||
cowsay = chain.process('cowsay')
|
||||
|
||||
chain.link(uptime.std_out, cowsay.std_in)
|
||||
chain.link(uptime.stdout, cowsay.stdin)
|
||||
chain.start(wait=True)
|
||||
|
||||
print cowsay.std_out
|
||||
print cowsay.stdout
|
||||
|
||||
|
||||
# ConnectedProcess
|
||||
# ActiveProcess
|
||||
# PassiveProcess
|
||||
# PassiveProcess
|
||||
Reference in New Issue
Block a user