Home | Trees | Index | Help |
|
---|
Package Pyblio :: Package Importers :: Module Tagged :: Class Parser |
|
object
--+
|
Parser
ISIParser
,
RISParser
Method Summary | |
---|---|
Create a new parser for a file containing 'tagged' records | |
field_data(self,
data)
| |
field_end(self)
| |
Transforms a single field of a record | |
field_start(self,
tag,
line)
| |
Override me to have a function called before the first record is to be parsed | |
Override me to be called after the last record has been parsed | |
Override me to be called just at the end of file | |
Override me to handle each line of input and generate self.push () events. | |
Call me to notify the availability of a new meta data | |
Call this function to get the next record as a list of tuples | |
Emit a new event. | |
record_end(self)
| |
record_start(self)
| |
Put back a line so that it will be returned by self._pop when it is next invoked. | |
Parse enough lines to get the next event | |
Return a line from the file with its line number. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Class Variable Summary | |
---|---|
int |
EV_DONE = 6 |
int |
EV_FIELD_DATA = 3 |
int |
EV_FIELD_END = 4 |
int |
EV_FIELD_START = 2 |
int |
EV_FILE_END = 5 |
int |
EV_METADATA = 7 |
int |
EV_RECORD_END = 1 |
int |
EV_RECORD_START = 0 |
int |
ST_IN_FIELD = 1 |
int |
ST_IN_RECORD = 0 |
int |
ST_OUTSIDE = 2 |
Method Details |
---|
__init__(self,
fd,
charset='UTF-8')
Create a new parser for a file containing 'tagged' records
|
field_handler(self, tag, value)Transforms a single field of a record |
file_start(self)Override me to have a function called before the first record is to be parsed |
file_stop(self)Override me to be called after the last record has been parsed |
file_stopping(self)Override me to be called just at the end of file |
line_handler(self, line, number)Override me to handle each line of input and generate self.push () events. Will be called with line == '' when the end of file is reached. |
metadata_add(self, tag, value)Call me to notify the availability of a new meta data |
next(self)Call this function to get the next record as a list of tuples ('D', [ (tag, value), ...]) ('M', tag, value) or None when there are no more records |
push(self, *ev)Emit a new event. Available events are listed below, with their additional parameters listed, when needed:
|
unread(self, line, count)Put back a line so that it will be returned by self._pop when it is next invoked. |
_ev_pop(self)Parse enough lines to get the next event |
_pop(self)Return a line from the file with its line number. |
Class Variable Details |
---|
EV_DONE
|
EV_FIELD_DATA
|
EV_FIELD_END
|
EV_FIELD_START
|
EV_FILE_END
|
EV_METADATA
|
EV_RECORD_END
|
EV_RECORD_START
|
ST_IN_FIELD
|
ST_IN_RECORD
|
ST_OUTSIDE
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Wed Jan 18 23:09:34 2006 | http://epydoc.sf.net |