asn1editor.view package

Submodules

asn1editor.view.AbstractView module

class asn1editor.view.AbstractView.AbstractView

Bases: object

Abstract representation of a view

realize() Any

@return: Class that contains the concrete view setup to the current state of the model

class asn1editor.view.AbstractView.ChoiceView

Bases: AbstractView, ABC

Abstract choice view allowing to replace the choice element view

set_view(view: AbstractView)

Replaces the choice element view

class asn1editor.view.AbstractView.ContainerView

Bases: AbstractView, ABC

Abstract container view allowing to add children

add_child(view: AbstractView)

Adds another abstract view as child of the container. Called while building the container.

class asn1editor.view.AbstractView.ListView

Bases: AbstractView, ABC

Abstract list view allowing to add and remove list elements

add(view: AbstractView)

Appends one more list element. Called whenever the list changes.

remove(view: AbstractView)

Removes the last list element. Called whenever the list changes.

asn1editor.view.AbstractViewFactory module

class asn1editor.view.AbstractViewFactory.AbstractViewFactory

Bases: object

Creates views for all types.

Depending on the type of view, further interfaces are returned to be used by the controllers to read and write the view’s contents.

get_bitstring_view(type_info: TypeInfo, number_of_bits: int, named_bits: List[Tuple[int, str]]) Tuple[AbstractView, BitstringInterface, OptionalInterface]
get_boolean_view(type_info: TypeInfo) Tuple[AbstractView, ValueInterface, OptionalInterface]
get_choice_view(type_info: TypeInfo, choices: List[str]) Tuple[ChoiceView, ValueInterface, OptionalInterface]
get_container_view(type_info: TypeInfo) Tuple[ContainerView, OptionalInterface]
get_date_view(type_info: TypeInfo) Tuple[AbstractView, ValueInterface, OptionalInterface]
get_datetime_view(type_info: TypeInfo) Tuple[AbstractView, ValueInterface, OptionalInterface]
get_enumerated_view(type_info: TypeInfo, choices: List[str]) Tuple[AbstractView, ValueInterface, OptionalInterface]
get_hex_string_view(type_info: TypeInfo, minimum: int | None, maximum: int | None) Tuple[AbstractView, ValueInterface, OptionalInterface]
get_list_view(type_info: TypeInfo, minimum: int, maximum: int) Tuple[ListView, ValueInterface, OptionalInterface]
get_number_view(type_info: TypeInfo, minimum: int, maximum: int, float_: bool) Tuple[AbstractView, ValueInterface, OptionalInterface]
get_string_view(type_info: TypeInfo, minimum: int, maximum: int) Tuple[AbstractView, ValueInterface, OptionalInterface]
get_text_view(type_info: TypeInfo, text: str) AbstractView
get_time_view(type_info: TypeInfo) Tuple[AbstractView, ValueInterface, OptionalInterface]
class asn1editor.view.AbstractViewFactory.Styles(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntFlag

Styling flags to change the look of elements READ_ONLY means that the element shall not be modifiable, indicating that the GUI elements shall be read only. HIDDEN means that the element’s data will be part of the model, but it shall not appear on the GUI

HIDDEN = 2
READ_ONLY = 1
class asn1editor.view.AbstractViewFactory.TypeInfo

Bases: object

Represents the info of an ASN.1 type required to create corresponding GUI controls

name: Name of the element tag: ASN.1 tag typename: Type of the underlying ASN.1 type optional: If set, the element may be present or not additional: If set, the element is part of the additional elements in an ASN.1 spec style: Additional styling flags help: Optional help string

additional: bool = False
help: str | None = None
name: str = ''
optional: bool = False
style: Styles = 0
tag: str = ''
typename: str = ''

Module contents