예제 #1
0
파일: clock.py 프로젝트: kriskowal/planes
 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},
         ),
     )
예제 #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,
)
예제 #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,
)