Module Spyder :: Class Stream
[hide private]
[frames] | no frames]

Class Stream

source code

object --+
         |
        Stream

Spyder-generated class

module builtin

file /home/sjoerd/Spyder-devel/builtin/Stream.spy

Description

Class representing the input/output of a UNIX pipe

"out" contains the data received from stdout / sent to stdin

"err" contains the data received from stderr

If "err" is empty, only "out" is printed by a "print" statement

Wiki

http://www.spyderware.nl/wiki/classes/Stream

Instance Methods [hide private]
 
pipe(self, cmd)
Opens a pipe to system command cmd...
source code
 
__or__(self, cmd)
Pipe operator | ; equivalent to self.pipe(...)
source code
 
join(self)
Adds self.err to self.out
source code
 
swap(self)
Swaps self.out and self.err
source code
 
chomp(self)
Removes trailing EOL of self.out and self.err
source code
 
lines(self)
Splits self.out into lines
source code
 
textdata(self)
Returns self.out.textdata()
source code
 
data(self)
Returns self.out.data()
source code
 
text(self)
Returns self.out.textdata()
source code
 
__str__(self)
if self.err is None, this is equivalent to str(self.out)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Instance Variables [hide private]
*Data out
*Data err
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

pipe(self, cmd)

source code 
Opens a pipe to system command cmd
self.out is sent to the pipe's stdin
Returns a Stream containing 
   the pipe's stdout in out 
   and self.err + the pipe's stderr in err

__str__(self)
(Informal representation operator)

source code 

if self.err is None, this is equivalent to str(self.out)

Overrides: object.__str__