def select_processor(div, state, method, field_name): for p in plugin.registry: if hasattr(p, method): desc = [] desc.append(p.__doc__) if hasattr(p, 'spec'): desc.append(h.span(' (See ', h.a('language specification', href=p.spec), ")")) if cgi_args.getfirst(field_name) == p.id: button = h.input(type="radio", name=field_name, checked='YES', value=p.id) else: button = h.input(type="radio", name=field_name, value=p.id) examples = h.span() if getattr(p, 'examples', []): examples << h.br() examples << "Load example input: " for (name, text) in p.examples: examples << h.input(type="submit", name="load_example", value=name) div << h.p(button, desc, examples)
def expander(name, inner): control = html.span("►", id="control-%s" % name, onclick='expand("%s");' % name) div = html.div(inner, id="inner-%s" % name, style="display: none;") return control + div
def select_middle(div, args): any = False line = h.p("[NOT WORKING RIGHT NOW]. Select plugins to instantiate: ") div << line for p in plugin.registry: if hasattr(p, "transform") or hasattr(p,"analyze"): line << h.span(p.id) # javascript so click makes a new block for it appear below.... line << " " any = True if not any: line << "(none available)."
def italize_control_char(line): return (html.span(line[0], **{"class": "h"}), line[1:])
def html(self, indent=0): out = html.span(str(self.addr).rjust(9), 'op-addr') out += ' ' out += html.span(html.pad(indent) + self.target.html() + ' = ' + self.source.html(), 'op-name') out += html.span(self.signature(), 'op-signature') return out + '\n'
def html(self): return html.span(self, 'constant')
def html(self): return html.span(self, 'register')