Home | Trees | Index | Help |
---|
Package RDFCalendar :: Module Parsers :: Class Reader |
|
A simple class wrapping a file, providing simple pushback capabilities.
Method Summary | |
---|---|
Initialise the object with the file 'f'. | |
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 from the stream until one of the 'targets' is seen. | |
If no pushed-back lines exist, read a line directly from the file. |
Method Details |
---|
__init__(self,
f,
non_standard_newline=0)
|
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. |
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sun Jun 17 23:59:41 2007 | http://epydoc.sf.net |