diff --git a/README.rst b/README.rst index 276b85c..128bce7 100644 --- a/README.rst +++ b/README.rst @@ -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() diff --git a/pipes.py b/pipes.py index f2f6689..53ddf14 100644 --- a/pipes.py +++ b/pipes.py @@ -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 \ No newline at end of file + pass diff --git a/t.py b/usage.py similarity index 67% rename from t.py rename to usage.py index dd2526d..7898fbd 100644 --- a/t.py +++ b/usage.py @@ -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 \ No newline at end of file +# PassiveProcess