election_day.screen_widgets.generic =================================== .. py:module:: election_day.screen_widgets.generic Attributes ---------- .. autoapisummary:: election_day.screen_widgets.generic.Entity election_day.screen_widgets.generic._E Classes ------- .. autoapisummary:: election_day.screen_widgets.generic.H1Widget election_day.screen_widgets.generic.H2Widget election_day.screen_widgets.generic.H3Widget election_day.screen_widgets.generic.PWidget election_day.screen_widgets.generic.HRWidget election_day.screen_widgets.generic.GridRowWidget election_day.screen_widgets.generic.GridColumnWidget election_day.screen_widgets.generic.PrincipalLogoWidget election_day.screen_widgets.generic.QrCodeWidget election_day.screen_widgets.generic.ModelBoundWidget election_day.screen_widgets.generic.ModelTitleWidget election_day.screen_widgets.generic.IfCompletedWidget election_day.screen_widgets.generic.IfNotCompletedWidget election_day.screen_widgets.generic.ModelProgressWidget election_day.screen_widgets.generic.CountedEntitiesWidget election_day.screen_widgets.generic.ChartWidget election_day.screen_widgets.generic.LastResultChangeWidget election_day.screen_widgets.generic.NumberOfCountedEntitiesWidget election_day.screen_widgets.generic.TotalEntitiesWidget Module Contents --------------- .. py:type:: Entity :canonical: Election | ElectionCompound | Vote .. py:data:: _E .. py:class:: H1Widget .. py:attribute:: tag :value: 'h1' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """

""" .. raw:: html
.. py:attribute:: usage :value: '

' .. py:class:: H2Widget .. py:attribute:: tag :value: 'h2' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """

""" .. raw:: html
.. py:attribute:: usage :value: '

' .. py:class:: H3Widget .. py:attribute:: tag :value: 'h3' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """

""" .. raw:: html
.. py:attribute:: usage :value: '

' .. py:class:: PWidget .. py:attribute:: tag :value: 'p' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """

""" .. raw:: html
.. py:attribute:: usage :value: '

' .. py:class:: HRWidget .. py:attribute:: tag :value: 'hr' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """
""" .. raw:: html
.. py:attribute:: usage :value: '
' .. py:class:: GridRowWidget .. py:attribute:: tag :value: 'grid-row' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """
""" .. raw:: html
.. py:attribute:: usage :value: '' .. py:class:: GridColumnWidget .. py:attribute:: tag :value: 'grid-column' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """
 
""" .. raw:: html
.. py:attribute:: usage :value: '' .. py:class:: PrincipalLogoWidget .. py:attribute:: tag :value: 'principal-logo' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ """ .. raw:: html
.. py:attribute:: usage :value: '' .. py:method:: get_variables(layout: onegov.election_day.layouts.DefaultLayout) -> dict[str, Any] .. py:class:: QrCodeWidget .. py:attribute:: tag :value: 'qr-code' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ """ .. raw:: html
.. py:attribute:: usage :value: '' .. py:method:: qr_code(url: str) -> str :staticmethod: .. py:method:: get_variables(layout: onegov.election_day.layouts.DefaultLayout) -> dict[str, Any] .. py:class:: ModelBoundWidget(model: _E | None = None) Bases: :py:obj:`Generic`\ [\ :py:obj:`_E`\ ] Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:attribute:: model :value: None .. py:method:: get_variables(layout: onegov.election_day.layouts.DefaultLayout) -> dict[str, Any] .. py:class:: ModelTitleWidget(model: _E | None = None) Bases: :py:obj:`ModelBoundWidget`\ [\ :py:obj:`Entity`\ ] Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:attribute:: tag :value: 'model-title' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ """ .. raw:: html
.. py:attribute:: usage :value: '' .. py:class:: IfCompletedWidget(model: _E | None = None) Bases: :py:obj:`ModelBoundWidget`\ [\ :py:obj:`Entity`\ ] Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:attribute:: tag :value: 'if-completed' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ """ .. raw:: html
.. py:attribute:: usage :value: '' .. py:class:: IfNotCompletedWidget(model: _E | None = None) Bases: :py:obj:`ModelBoundWidget`\ [\ :py:obj:`Entity`\ ] Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:attribute:: tag :value: 'if-not-completed' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ """ .. raw:: html
.. py:attribute:: usage :value: '' .. py:class:: ModelProgressWidget(model: _E | None = None) Bases: :py:obj:`ModelBoundWidget`\ [\ :py:obj:`Entity`\ ] Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:attribute:: tag :value: 'model-progress' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ """ .. raw:: html
.. py:attribute:: usage :value: '' .. py:class:: CountedEntitiesWidget(model: _E | None = None) Bases: :py:obj:`ModelBoundWidget`\ [\ :py:obj:`Entity`\ ] Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:attribute:: tag :value: 'counted-entities' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ ${entities} """ .. raw:: html
.. py:attribute:: usage :value: '' .. py:method:: get_variables(layout: onegov.election_day.layouts.DefaultLayout) -> dict[str, Any] .. py:class:: ChartWidget(model: _E | None = None) Bases: :py:obj:`ModelBoundWidget`\ [\ :py:obj:`_E`\ ] Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:method:: get_variables(layout: onegov.election_day.layouts.DefaultLayout) -> dict[str, Any] .. py:class:: LastResultChangeWidget(model: _E | None = None) Bases: :py:obj:`ModelBoundWidget`\ [\ :py:obj:`Entity`\ ] Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:attribute:: tag :value: 'last-result-change' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ ${layout.format_date(layout.last_result_change, 'datetime_long')} """ .. raw:: html
.. py:attribute:: usage :value: '' .. py:class:: NumberOfCountedEntitiesWidget(model: _E | None = None) Bases: :py:obj:`ModelBoundWidget`\ [\ :py:obj:`Entity`\ ] Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:attribute:: tag :value: 'number-of-counted-entities' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ ${layout.format_number(model.progress[0])} """ .. raw:: html
.. py:attribute:: usage :value: '' .. py:class:: TotalEntitiesWidget(model: _E | None = None) Bases: :py:obj:`ModelBoundWidget`\ [\ :py:obj:`Entity`\ ] Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:attribute:: tag :value: 'total-entities' .. py:attribute:: template :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ ${layout.format_number(model.progress[1])} """ .. raw:: html
.. py:attribute:: usage :value: ''