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
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
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%"
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
def get_creator(self): def _creator(container, data): return create_POM(data, container.dtd) return partial(_creator, self)
def get_nodemaker(self): def _make_node(container, name, attribs, *contents): return container.make_node(name, attribs, *contents) return partial(_make_node, self)