Пример #1
0
 def register_now_button(self, *a, **k):
     if fields.validate(k):
         values = fields.evaluate()
         if values['PASSWORD'] == values['CONFIRM']:
             if submit_registration(values):
                 return page(load_content('step2.txt'))
Пример #2
0
Leaflet
----
* [Simple Map]({path}/leaflet-simple)
* [Map Markers]({path}/leaflet-markers)

Sparklines
----
* [Sparkline Line]({path}/sparkline)
* [Sparkline Bar]({path}/sparkbar)
""".format(path='/'+'/'.join([
    system.app.name,
    'data-visualization',
]))

tpl = load_content('visualization-layout')


def get_code(method):
    source = getsource(method)
    lines = [l[4:] for l in source.splitlines()[1:-1]]
    selection = '\n'.join(lines)
    return markdown(selection)


class MyView(View):

    def index(self):
        def get_title(method):
            code = getsource(method)
            title = method.__doc__.splitlines()[0]
Пример #3
0
Leaflet
----
* [Simple Map]({path}/leaflet-simple)
* [Map Markers]({path}/leaflet-markers)

Sparklines
----
* [Sparkline Line]({path}/sparkline)
* [Sparkline Bar]({path}/sparkbar)
""".format(path='/' + '/'.join([
    system.app.name,
    'data-visualization',
]))

tpl = load_content('visualization-layout')


def get_code(method):
    source = getsource(method)
    lines = [l[4:] for l in source.splitlines()[1:-1]]
    selection = '\n'.join(lines)
    return markdown(selection)


class MyView(View):
    def index(self):
        def get_title(method):
            code = getsource(method)
            title = method.__doc__.splitlines()[0]
            return title