Trees | Indices | Help |
---|
|
Code to support writing parsers. Classes: AbstractParser Base class for parsers. AbstractConsumer Base class of all Consumers. TaggingConsumer Consumer that tags output with its event. For debugging SGMLStrippingConsumer Consumer that strips SGML tags from output. EventGenerator Generate Biopython Events from Martel XML output (note that Martel is now DEPRECATED) Functions: safe_readline Read a line from a handle, with check for EOF. safe_peekline Peek at next line, with check for EOF. read_and_call Read a line from a handle and pass it to a method. read_and_call_while Read many lines, as long as a condition is met. read_and_call_until Read many lines, until a condition is met. attempt_read_and_call Like read_and_call, but forgiving of errors. is_blank_line Test whether a line is blank.
|
|||
AbstractParser Base class for other parsers. |
|||
AbstractConsumer Base class for other Consumers. |
|||
TaggingConsumer A Consumer that tags the data stream with the event and prints it to a handle. |
|||
SGMLStrippingConsumer A consumer that strips off SGML tags. |
|||
EventGenerator Handler to generate events associated with a Martel parsed file. |
|
|||
|
|||
|
|||
number of lines |
|
||
boolean |
|
||
|
|||
boolean |
|
||
line |
|
||
line |
|
|
|||
xml_support = 1
|
|||
__package__ =
|
|
read_and_call(uhandle, method[, start][, end][, contains][, blank][, has_re]) Read a line from uhandle, check it, and pass it to the method. Raises a ValueError if the line does not pass the checks. start, end, contains, blank, and has_re specify optional conditions that the line must pass. start and end specifies what the line must begin or end with (not counting EOL characters). contains specifies a substring that must be found in the line. If blank is a true value, then the line must be blank. has_re should be a regular expression object with a pattern that the line must match somewhere. |
read_and_call_while(uhandle, method[, start][, end][, contains][, blank][, has_re]) -> number of lines Read a line from uhandle and pass it to the method as long as some condition is true. Returns the number of lines that were read. See the docstring for read_and_call for a description of the parameters. |
Read a line from uhandle and pass it to the method until some condition is true. Returns the number of lines that were read. See the docstring for read_and_call for a description of the parameters.
|
Similar to read_and_call, but returns a boolean specifying whether the line has passed the checks. Does not raise exceptions. See docs for read_and_call for a description of the function arguments.
|
Return whether a line is blank. allow_spaces specifies whether to allow whitespaces in a blank line. A true value signifies that a line containing whitespaces as well as end-of-line characters should be considered blank.
|
Read a line from an UndoHandle and return it. If there are no more lines to read, I will raise a ValueError.
|
Peek at the next line in an UndoHandle and return it. If there are no more lines to peek, I will raise a ValueError.
|
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Sep 22 19:52:22 2009 | http://epydoc.sourceforge.net |