Exemplo n.º 1
0
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)
Exemplo n.º 2
0
def expander(name, inner):
    control = html.span("&#x25ba;",
                        id="control-%s" % name,
                        onclick='expand("%s");' % name)
    div = html.div(inner, id="inner-%s" % name, style="display: none;")

    return control + div
Exemplo n.º 3
0
def expander(name, inner):
	control = html.span("&#x25ba;",
	                    id="control-%s" % name,
	                    onclick='expand("%s");' % name)
	div = html.div(inner,
	               id="inner-%s" % name,
	               style="display: none;")

	return control + div
Exemplo n.º 4
0
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)."
Exemplo n.º 5
0
 def italize_control_char(line):
     return (html.span(line[0], **{"class": "h"}), line[1:])
Exemplo n.º 6
0
 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'
Exemplo n.º 7
0
 def html(self):
     return html.span(self, 'constant')
Exemplo n.º 8
0
 def html(self):
     return html.span(self, 'register')