RDFCalendar.Parsers.Reader

Package RDFCalendar :: Module Parsers :: Class Reader |
[show private | hide private]
[frames | no frames]

## Class Reader

    A simple class wrapping a file, providing simple pushback capabilities.

Method Summary
| ``__init__`(self, f)` Initialise the object with the file 'f'.
| ``pushback`(self, line)` Push the given 'line' back so that the next line read is actually the given 'line' and not the next line from the underlying file.
| ``read_until`(self, targets)` Read from the stream until one of the 'targets' is seen.
| ``readline`(self)` If no pushed-back lines exist, read a line directly from the file.

Method Details

### __init__(self, f) (Constructor)
    Initialise the object with the file 'f'.

### pushback(self, line)
    Push the given 'line' back so that the next line read is actually the
    given 'line' and not the next line from the underlying file.

### read_until(self, targets)
    Read from the stream until one of the 'targets' is seen. Return the
    string from the current position up to the target found, along with the
    target string, using a tuple of the form (string, target). If no target
    was found, return the entire string together with a target of None.

### readline(self)
    If no pushed-back lines exist, read a line directly from the file.
    Otherwise, read from the list of pushed-back lines.

Generated by Epydoc 2.1 on Tue Mar 27 01:15:38 2007 | http://epydoc.sf.net