Package madgraph :: Package madweight :: Module MW_fct :: 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. I believe all the corner cases are handled, but never can be sure...

Instance Methods [hide private]
next line from the file, as a string
readline(self)
Retain newline.
source code
file object
__init__(self, filepos, blksize=4096)
initialize the internal structures
source code

Inherited from file: __delattr__, __enter__, __exit__, __getattribute__, __iter__, __new__, __repr__, __setattr__, close, fileno, flush, isatty, next, 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 

Retain newline. A non-negative size argument limits the maximum number of bytes to return (an incomplete line may be returned then). Return an empty string at EOF.

Returns: next line from the file, as a string
Overrides: file.readline
(inherited documentation)

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

source code 

initialize the internal structures

Returns: file object
Overrides: object.__init__