Package mekano :: Module io :: Class SMARTParser
[hide private]
[frames] | no frames]

Class SMARTParser

source code

StateMachineFileParser --+
                         |
                        SMARTParser

SMART file parser

>>> tp = SMARTParser(callback, sections = None)

The callback function receives (docid, cats, text).

sections: None: Read all sections, or ["T", "W"]: Only read sections .T and .W

To begin parsing, use one of:

Instance Methods [hide private]
 
__init__(self, callback, sections=None) source code
 
_onInit(self) source code
 
_onMisc(self, line)
Waiting for a new doc to start
source code
 
_onGotDocId(self, line)
Waiting for the .C section to start
source code
 
_onSawDotC(self, line)
Reading the categories line
source code
 
_onSectionHeader(self, line)
Reading the section header line
source code
 
_onSectionText(self, line)
Seeing text lines
source code
 
_onFinish(self) source code
 
_doCallBack(self) source code

Inherited from StateMachineFileParser: close, parse, parseFile, parseFileName

Inherited from StateMachineFileParser (private): _introspect

Method Details [hide private]

__init__(self, callback, sections=None)
(Constructor)

source code 
Overrides: StateMachineFileParser.__init__

_onFinish(self)

source code 
Overrides: StateMachineFileParser._onFinish