Package gavo :: Package grammars :: Module common :: Class FilteredInputFile
[frames] | no frames]

Class FilteredInputFile

source code

object --+
         |
        FilteredInputFile

a pseudo-file that allows piping data thorugh a shell command.

It supports read, readline, and close. Close closes the original file, too.

Warning: the command passed in will be shell-expanded (which is fair since you can pass in any command you want anyway).

If you pass silent=True, stderr will be redirected to /dev/null. This is probably only attractive for unit tests and such.

Instance Methods
 
__init__(self, filterCommand, origFile, silent=False)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
read(self, nBytes=None) source code
 
readline(self) source code
 
__iter__(self) source code
 
close(self) source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, filterCommand, origFile, silent=False)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)