Package schrodinger :: Package application :: Package jaguar :: Module textparser :: Class line_enumerate
[hide private]
[frames] | no frames]

Class line_enumerate

object --+
         |
        line_enumerate


A simple wrapper class to keep track of the line iteration count.

The builtin enumerate function isn't practical for TextParser since it
passes around the iterator and uses explicit next() calls.

Public attributes:

line_num
    The line number of the last line returned.

line
    The last line returned.

iter
    The underlying iterator.

Instance Methods [hide private]
 
__init__(self, iter_)
Constructor.
 
__iter__(self)
 
next(self)
 
__getattr__(self, attr)
Fall back to underlying iterator attributes so you can do things like get a file iterator's name.

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, iter_)
(Constructor)

 

Constructor.

iter (iterator)
    The iterator being wrapped.

Overrides: object.__init__