|
def | __init__ (self, key, pyparser=None, default=None, initvalue=None, data_name=None, list_merge=False, asList=False, asDict=False, required=False) |
|
def | add (self, obj) |
|
def | __iadd__ (self, obj) |
|
def | get_globals (self) |
|
def | find_parser (self, text) |
|
def | can_parse (self, text) |
|
def | initial (self, text, comment) |
|
def | parse (self, node, text, comment) |
|
def | pyparse (self, text) |
|
def | fin (self, node) |
|
def | pop (self, new, name) |
|
def | flatten (self, new) |
|
def | merge (self, orig, new) |
|
|
| key |
|
| flat_key |
|
| data_name |
|
| default |
|
| initvalue |
|
| pyparser |
|
| list_merge |
|
| asList |
|
| asDict |
|
| children |
|
| parent |
|
| globals |
|
| required |
|
◆ __init__()
def pybis.Parse.__init__ |
( |
|
self, |
|
|
|
key, |
|
|
|
pyparser = None , |
|
|
|
default = None , |
|
|
|
initvalue = None , |
|
|
|
data_name = None , |
|
|
|
list_merge = False , |
|
|
|
asList = False , |
|
|
|
asDict = False , |
|
|
|
required = False |
|
) |
| |
key: Name of element.
pyparser: Parser to call with pyparse
default: Default value of object if not found
initvalue: Default value of object on first merge
data_name: Make the data of this node a child with name 'data_name'
list_merge: Merge multiple copies together as list
asList: Interpret pyparse results as a list
asDict: Interpret pyparse results as a dict
required: raise Exception if not found
◆ can_parse()
def pybis.Parse.can_parse |
( |
|
self, |
|
|
|
text |
|
) |
| |
True if we can parse 'text'.
◆ fin()
def pybis.Parse.fin |
( |
|
self, |
|
|
|
node |
|
) |
| |
Add a node to the parent.
◆ find_parser()
def pybis.Parse.find_parser |
( |
|
self, |
|
|
|
text |
|
) |
| |
Find a child parser that can parse 'text'.
◆ flatten()
def pybis.Parse.flatten |
( |
|
self, |
|
|
|
new |
|
) |
| |
Reformat pyparse results as what we'd expect.
◆ get_globals()
def pybis.Parse.get_globals |
( |
|
self | ) |
|
Get the global parse object, for things that are parseable in all contexts.
◆ initial()
def pybis.Parse.initial |
( |
|
self, |
|
|
|
text, |
|
|
|
comment |
|
) |
| |
Parse the first line of text and return a Node object.
◆ merge()
def pybis.Parse.merge |
( |
|
self, |
|
|
|
orig, |
|
|
|
new |
|
) |
| |
Merge two instances of the same parser under one parent.
◆ parse()
def pybis.Parse.parse |
( |
|
self, |
|
|
|
node, |
|
|
|
text, |
|
|
|
comment |
|
) |
| |
Parse a subsequent line of text, False means we can't.
◆ pop()
def pybis.Parse.pop |
( |
|
self, |
|
|
|
new, |
|
|
|
name |
|
) |
| |
Remove 'name' from ParseResults 'new'.
◆ pyparse()
def pybis.Parse.pyparse |
( |
|
self, |
|
|
|
text |
|
) |
| |
Use self.pyparser to parse 'text', returns parse tokens.
Returns 'text' if there is no pyparser object.
The documentation for this class was generated from the following file: