Esempio n. 1
0
host = HostService()

serve(
    PathService(
        host = host,
        contents = {'.adhoc': host,},
        service = WidgetService(
            tags.div(
                VerticalSplitWidget(
                    tags.div(
                        tags.h1('Powers of Two'),
                        Widget(tuple(2 ** n for n in range(200))),
                        style = 'padding: 10px;'
                    ),
                    tags.div(
                        tags.h1(
                            ClockWidget(),
                        ),
                        style = '''
                            text-align: center;
                            padding: 10px;
                        ''',
                    ),
                )
            )
        ),
    ),
    port = 8080,
    debug = True,
)

Esempio n. 2
0
)

from planes.python.html import tags

host = HostService()
serve(
    service = HostService(
        contents = {
            'widget': WidgetService(ShellWidget()),
            'service': ShellService(),
            'both': ShellService(
                body = tags.div(
                    ShellWidget(),
                    style = '''
                        position: fixed;
                        top: 10px;
                        right: 10px;
                        bottom: 10px;
                        width: 25%;
                    '''
                )
            ),
            '.host': host,
        },
        host = host,
    ),
    port = 8080,
    debug = True,
)