Package madgraph :: Package various :: Module misc :: Class BackRead
[hide private]
[frames] | no frames]

Class BackRead

source code

object --+    
         |    
      file --+
             |
            BackRead

read a file returning the lines in reverse order for each call of readline() This actually just reads blocks (4096 bytes by default) of data from the end of the file and returns last line in an internal buffer.

Instance Methods [hide private]
next line from the file, as a string
readline(self)
readline in a backward way
source code
file object
__init__(self, filepos, blksize=4096)
initialize the internal structures
source code
the next value, or raise StopIteration
next(self) source code

Inherited from file: __delattr__, __enter__, __exit__, __getattribute__, __iter__, __new__, __repr__, __setattr__, close, fileno, flush, isatty, read, readinto, readlines, seek, tell, truncate, write, writelines, xreadlines

Inherited from object: __format__, __hash__, __reduce__, __reduce_ex__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from file: closed, encoding, errors, mode, name, newlines, softspace

Inherited from object: __class__

Method Details [hide private]

readline(self)

source code 

readline in a backward way

Returns: next line from the file, as a string
Overrides: file.readline

__init__(self, filepos, blksize=4096)
(Constructor)

source code 

initialize the internal structures

Returns: file object
Overrides: object.__init__

next(self)

source code 
Returns: the next value, or raise StopIteration
Overrides: file.next
(inherited documentation)