Exemple #1
0
 def fetch_form_elements(self):
     """Return active form element nodes, grouped by name in a dictionary."""
     rv = {}
     visitor = partial(self._check_node, rv)
     for node in self._children:
         node.walk(visitor)
     return rv
Exemple #2
0
 def fetch_form_elements(self):
     """Return active form element nodes, grouped by name in a dictionary."""
     rv = {}
     visitor = partial(self._check_node, rv)
     for node in self._children:
         node.walk(visitor)
     return rv
Exemple #3
0
def _parse_parameters(text):
    def _ParserCB(d, argv):
        for param in argv:
            if param.find("=") > 0:
                key, value = param.split("=", 1)
                d[key] = value

    d = {}
    p = shparser.ShellParser(aid.partial(_ParserCB, d))
    p.feed(text)
    p.feed("\n")
    return d
Exemple #4
0
def _parse_parameters(text):

    def _ParserCB(d, argv):
        for param in argv:
            if param.find("=") > 0:
                key, value = param.split("=", 1)
                d[key] = value

    d = {}
    p = shparser.ShellParser(aid.partial(_ParserCB, d))
    p.feed(text)
    p.feed("\n")
    return d
Exemple #5
0
def get_header_table(section, environ):
    d = dict([(k[5:].replace("_", "-").capitalize(), v)
              for k, v in environ.items() if k.startswith("HTTP")])
    tbl = section.new_table(d.keys(), [partial(renderval, d)],
                            ("HTTP Header", "Value"))
    tbl.width = "100%"
Exemple #6
0
 def fetch_form_values(self, container=None):
     rv = container or []
     visitor = partial(self._get_node_value, rv)
     for node in self._children:
         node.walk(visitor)
     return rv
Exemple #7
0
 def get_creator(self):
     def _creator(container, data):
         return create_POM(data, container.dtd)
     return partial(_creator, self)
Exemple #8
0
 def get_nodemaker(self):
     def _make_node(container, name, attribs, *contents):
         return container.make_node(name, attribs, *contents)
     return partial(_make_node, self)
Exemple #9
0
    def get_nodemaker(self):
        def _make_node(container, name, attribs, *contents):
            return container.make_node(name, attribs, *contents)

        return partial(_make_node, self)
Exemple #10
0
def get_header_table(section, environ):
    d = dict([(k[5:].replace("_", "-").capitalize(), v) for k, v in environ.items() if k.startswith("HTTP")])
    tbl = section.new_table(d.keys(), [partial(renderval, d)], ("HTTP Header", "Value"))
    tbl.width = "100%"
Exemple #11
0
    def get_creator(self):
        def _creator(container, data):
            return create_POM(data, container.dtd)

        return partial(_creator, self)
Exemple #12
0
 def fetch_form_values(self, container=None):
     rv = container or []
     visitor = partial(self._get_node_value, rv)
     for node in self._children:
         node.walk(visitor)
     return rv