Package multi :: Module processor_io :: Class Redirect_text
[hide private]
[frames] | no frames]

Class Redirect_text

source code


Store the data of the IO streams, prepending a token to each line of written text.

Instance Methods [hide private]
 
__init__(self, data, token='', stream=0)
Set up the text redirection object.
source code
 
flush(self)
Dummy flush method.
source code
bool
isatty(self)
Answer that this is not a TTY.
source code
 
write(self, string)
Replacement write() method.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, data, token='', stream=0)
(Constructor)

source code 

Set up the text redirection object.

Parameters:
  • data (list of lists) - The data object to store all IO in.
  • token (str) - The string to add to the end of all newlines.
  • stream (int) - The type of steam (0 for STDOUT and 1 for STDERR).
Overrides: object.__init__

isatty(self)

source code 

Answer that this is not a TTY.

Returns: bool
False, as this is not a TTY.

write(self, string)

source code 

Replacement write() method.

This prepends the token to each line of STDOUT and STDERR and stores the result together with the stream number.

Parameters:
  • string (str) - The text to write.