File: html.py

package info (click to toggle)
python-trame-client 3.11.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,128 kB
  • sloc: python: 9,609; javascript: 3,897; sh: 9; makefile: 6
file content (39 lines) | stat: -rw-r--r-- 1,046 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from .core import AbstractLayout
from ..widgets.html import Div

__all__ = [
    "DivLayout",
]


class DivLayout(AbstractLayout):
    def __init__(
        self,
        _server,
        template_name="main",
        connect_parent=True,
        style=None,
        classes=None,
        **kwargs,
    ):
        """
        Simple <div> element as a layout

        :param _server: Server to bound the layout to
        :param template_name: Name of the template (default: main)
        :param connect_parent: Control registration to parent context manager
        :param style: Forwarded to root Div element
        :param classes: Forwarded to root Div element
        :param **kwargs: Optional arguments pass to the <Div> element
        """
        super().__init__(
            _server,
            Div(
                trame_server=_server,
                connect_parent=connect_parent,
                style=style,
                classes=classes,
            ),
            template_name=template_name,
            **kwargs,
        )