|
HWRF
trunk@4391
|
Config file parser. More...
Config file parser.
Parses comment blocks as described in the confdoc.
Definition at line 565 of file confdoc.py.
Public Member Functions | |
| def | __init__ |
| Opens the specified file, prepares to parse. More... | |
| def | eot (self) |
| Have we run out of lines to parse? | |
| def | match (self, pattern) |
| Calls re.match(pattern,...) on the current line, returning the result. More... | |
| def | parse (self) |
| Loops over all lines, parsing text and sending the result to global variables. More... | |
| def | readoption (self, name) |
| Reads later lines of a multi-line option=value assignment. More... | |
| def | readblock (self) |
| Reads the second and later lines of a multi-line comment block. More... | |
Public Attributes | |
| doc | |
| lines | |
| iline | |
| Current line number counting from 0. | |
| basename | |
| Basename of the current file. | |
| doxified | |
| The basename with "." replaced with "_". | |
| brief | |
| Brief portion of description that has not yet been assigned to an option or section. More... | |
| detail | |
| Detailed portion of description that has not yet been assigned to an option or section. More... | |
| section | |
| Section being parsed. | |
| value | |
| def confdoc.parsefile.__init__ | ( | self, | |
| filename, | |||
| doc, | |||
maxread = 500000 |
|||
| ) |
Opens the specified file, prepares to parse.
Only the first maxread bytes are read.
| filename | the *.conf file to read |
| doc | the docbase object to receive documentation |
| maxread | maximum number of lines to read |
Definition at line 568 of file confdoc.py.
| def confdoc.parsefile.match | ( | self, | |
| pattern | |||
| ) |
Calls re.match(pattern,...) on the current line, returning the result.
| pattern | argument to re.match: the pattern to match |
Definition at line 607 of file confdoc.py.
Referenced by confdoc.parsefile.parse(), confdoc.parsefile.readblock(), and confdoc.parsefile.readoption().
| def confdoc.parsefile.parse | ( | self | ) |
Loops over all lines, parsing text and sending the result to global variables.
Definition at line 615 of file confdoc.py.
Referenced by hwrf.input.DataCatalog.locate().
| def confdoc.parsefile.readblock | ( | self | ) |
Reads the second and later lines of a multi-line comment block.
Assumes data is already in the self.brief variable.
Definition at line 735 of file confdoc.py.
Referenced by confdoc.parsefile.parse().
| def confdoc.parsefile.readoption | ( | self, | |
| name | |||
| ) |
Reads later lines of a multi-line option=value assignment.
| name | the option name |
Definition at line 719 of file confdoc.py.
Referenced by confdoc.parsefile.parse().
| confdoc.parsefile.brief |
Brief portion of description that has not yet been assigned to an option or section.
Definition at line 580 of file confdoc.py.
Referenced by confdoc.parsefile.parse(), confdoc.parsefile.readblock(), and confdoc.parsefile.readoption().
| confdoc.parsefile.detail |
Detailed portion of description that has not yet been assigned to an option or section.
Definition at line 581 of file confdoc.py.
Referenced by confdoc.parsefile.parse(), confdoc.parsefile.readblock(), and confdoc.parsefile.readoption().
1.8.10