Package CHEM :: Package ML :: Module Util :: Class FeatureDictReaderFactory
[hide private]
[frames] | no frames]

Class FeatureDictReaderFactory



Common.IteratorFactory.IteratorFactory --+    
                                         |    
        Common.IteratorFactory.FileFactory --+
                                             |
                                            FeatureDictReaderFactory

Simple extension of the FileFactory, which takes care of temp file creation (as necessary) and special treatment of the "-" stdin filename.

Instance Methods [hide private]
 
__init__(self, aFile)
Constructor, taking the filename or file object to create iterators for.
 
__iter__(self)
Only modification is the actual iterator method which returns a FeatureDictReader wrapper around the file, not the file itself.

Inherited from Common.IteratorFactory.FileFactory: __del__

Class Variables [hide private]

Inherited from Common.IteratorFactory.FileFactory: fd, filename, usedTempFile

Method Details [hide private]

__init__(self, aFile)
(Constructor)

 

Constructor, taking the filename or file object to create iterators for.

If a string filename is given, then just use that directly. Otherwise, if a file object is given, or the filename specifies stdin, then a temporary file copy will be created.
Overrides: Common.IteratorFactory.FileFactory.__init__

__iter__(self)

 
Only modification is the actual iterator method which returns a FeatureDictReader wrapper around the file, not the file itself.
Overrides: Common.IteratorFactory.FileFactory.__iter__