Example #1
0
 def __html_repr__(self, kit):
     tags = kit.tags
     host = kit.host
     id = kit.next_id()
     session_url = host(
         object = self,
         expires = True,
         service = FunctionService(time.asctime),
     )
     print session_url
     return tags.div(
         tags.div('', id = id),
         Javascript(
             '''clock.init(%s, %s, %s)''' % (
                 repr(id),
                 repr(session_url),
                 repr({'pollingInterval': 1500, 'debug': 1}),
             ),
             {'clock': ClockWidget.javascript},
         ),
     )
Example #2
0
    PathService(
        host = host,
        contents = {
            'adhoc': host,
        },
        service = WidgetService(
            tags.div(
                MagnetWidget(string) for string in (
                    'a',
                    'a',
                    'the',
                    'the',
                    'and',
                    'or',
                    'with',
                    'woman',
                    'man',
                    'puppy',
                    'unicorn',
                    'hopped',
                    'killed',
                    'bludgeoned',
                    'eviscerated',
                    'in bed',
                )[::-1]
            ),
        ),
    ),
    port = 8080,
    debug = True,
)
Example #3
0
serve(
    PathService(
        host=host,
        contents={"adhoc": host},
        service=WidgetService(
            tags.div(
                MobileWidget(string)
                for string in (
                    "a",
                    "a",
                    "the",
                    "the",
                    "and",
                    "or",
                    "with",
                    "woman",
                    "man",
                    "puppy",
                    "unicorn",
                    "hopped",
                    "killed",
                    "bludgeoned",
                    "eviscerated",
                    "in bed",
                )[::-1]
            )
        ),
    ),
    port=8080,
    debug=True,
)