Ejemplo n.º 1
0
 def __init__(self, **kwargs):
     k = {
         'parser': SSVParser(maxsplit=1),
         'builder': BoundBuilder(SNMPDData),
     }
     k.update(kwargs)
     Reconfig.__init__(self, **k)
Ejemplo n.º 2
0
 def __init__(self, **kwargs):
     k = {
         'parser': SSVParser(separator=':'),
         'builder': BoundBuilder(GroupsData),
     }
     k.update(kwargs)
     Reconfig.__init__(self, **k)
Ejemplo n.º 3
0
 def __init__(self, **kwargs):
     k = {
         'parser': SSVParser(separator=' '),
         'builder': BoundBuilder(PublicAddressesData),
     }
     k.update(kwargs)
     Reconfig.__init__(self, **k)
Ejemplo n.º 4
0
class SSVParserTest (BaseParserTest):
    parser = SSVParser(continuation='\\')
    source = """# line1
# long comment
a\tbc\\
\tdef
efgh # line2
"""
    parsed = RootNode(
        None,
        Node(
            'line',
            Node('token', PropertyNode('value',  'a')),
            Node('token', PropertyNode('value',  'bc')),
            Node('token', PropertyNode('value',  'def')),
            comment='line1\nlong comment',
        ),
        Node(
            'line',
            Node('token', PropertyNode('value',  'efgh')),
            comment='line2',
        ),
    )

    @property
    def stringified(self):
        return """# line1
Ejemplo n.º 5
0
 def __init__(self, **kwargs):
     k = {
         'parser': SSVParser(),
         'builder': BoundBuilder(NodesData),
     }
     k.update(kwargs)
     Reconfig.__init__(self, **k)