asn1editor.wxPython package¶
Submodules¶
asn1editor.wxPython.Environment module¶
- asn1editor.wxPython.Environment.load()¶
- asn1editor.wxPython.Environment.log_error(log_message: str)¶
- asn1editor.wxPython.Environment.save()¶
asn1editor.wxPython.FilePickerHandler module¶
asn1editor.wxPython.ImageList module¶
asn1editor.wxPython.MainWindow module¶
- class asn1editor.wxPython.MainWindow.MainWindow(plugins: List[Plugin] | None = None, type_augmenter: TypeAugmenter | None = None, title='ASN.1 editor 0.8.0', enable_load_last=True)¶
Bases:
Frame,PluginInterface- choice_entry(message: str, caption: str, choices: List[str], default: str | None = None) str | None¶
Queries the user for a choice of values.
@param message: Message to show to the user @param caption: Message box caption @param choices: List of strings for the user to choose from @param default: Default selection
@return: Selected string, None if cancelled
- close(e: Event)¶
- dir_picker(message: str) str | None¶
Opens a dir picker where the user can choose a directory name and returns this chosen name.
@param message: Message to show in the dir picker
@return: Selected directory, None if cancelled
- encode_data(codec: str) bytes¶
Encodes the data currently edited in the editor window with an ASN.1 codec.
@param codec: Codec to use for encoding (reference asn1tools which ones are supported)
@return: Encoded data
- file_picker(message: str, wildcard: str, open_: bool) str | None¶
Opens a file picker where the user can choose a file name and returns this chosen name.
@param message: Message to show in the file picker @param wildcard: Wildcards to offer the user in order to help him choose the correct file types @param open_: Flag if the dialog shall be an open dialog (True) or a save dialog (false)
@return: Selected file, None if cancelled
- get_settings() dict¶
Get a settings dictionary for a plugin to store persistent data
@return: Settings dict
- get_spec(codec: str)¶
@param codec: Codec to use (reference asn1tools which ones are supported)
@return: The compiled ASN.1 specification as an object defined by asn1tools.
- get_spec_filename() str¶
@return: The file name of the ASN.1 specification file currently loaded.
- get_typename() str¶
@return: The name of the currently used type name in the editor.
- load_data_from_file(file_name: str)¶
- load_spec(file_name: str | None, type_name: str | None = None) bool¶
Loads an ASN.1 specification in the editor.
@param file_name: File name of the ASN.1 specification @param type_name: Optional type name indication. Format: [Module name].[Type name]
@return: True if data was loaded successfully
- save_data_to_file(file_name: str)¶
- show_data(data: bytes, codec: str)¶
Decodes and shows data from an ASN.1 encoded byte stream in the editor.
@param data: Byte stream with ASN.1 encoded data @param codec: Codec to use for decoding (reference asn1tools which ones are supported)
- show_message(message: str, caption: str, message_type: MessageType) bool¶
Shows a status message.
@param message: Message to show to the user @param caption: Message box caption @param message_type: Type of message box
@return: If type is a question, True means yes and False means No
- show_progress(message: str, caption: str, max_progress: int | None = None)¶
Shows a progress window
@param message: Message to show to the user @param caption: Message box caption @param max_progress: Maximum progress value
- show_status(message: str)¶
Shows a status message.
@param message: Message to show to the user
- text_entry(message: str, default: str | None = None) str | None¶
Queries a text from the user.
@param message: Message to show to the user @param default: Default value for the text entry
@return: Entered text, None if cancelled
- update_progress(message: str | None = None, close: bool = False, progress: int | None = None) bool¶
Updates a shown progress window
@param message: Updated message to show to the user, optional @param close: If set, window is closed, optional @param progress: Progress to show, if none, an indeterminate process is shown, optional
@return: False if progress window has been canceled, otherwise True
asn1editor.wxPython.MenuHandler module¶
- class asn1editor.wxPython.MenuHandler.MenuHandler(frame: Frame, plugins: List[Plugin] | None, about_box_content: str)¶
Bases:
object- add_recent(filename: str, typename: str)¶
- build(load_spec: Callable, load_data_from_file: Callable, save_data_to_file: Callable, view_changed: Callable)¶
- enable(enable: bool = True)¶
- property load_last: bool¶
- property recent: List[List[str]]¶
asn1editor.wxPython.Resources module¶
- asn1editor.wxPython.Resources.get_bitmap_from_svg(bitmap_name) Bitmap¶
- asn1editor.wxPython.Resources.plugin_resource_path(relative_path: str) str¶
Get absolute path to resource required for PyInstaller/py2exe
- asn1editor.wxPython.Resources.resource_path(relative_path: str) str¶
Get absolute path to resource required for PyInstaller/py2exe
asn1editor.wxPython.SingleFileDropTarget module¶
asn1editor.wxPython.Styler module¶
asn1editor.wxPython.TreeView module¶
asn1editor.wxPython.ViewSelect module¶
- class asn1editor.wxPython.ViewSelect.RadioHandler(names_and_values: List[Tuple[str, int]])¶
Bases:
object- bind(frame: Frame, callback: Callable)¶
- property value: int¶
- class asn1editor.wxPython.ViewSelect.TagInfo(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum- LABELS = 1¶
- TOOLTIPS = 0¶
- class asn1editor.wxPython.ViewSelect.ViewSelect(frame: Frame, change_callback: Callable)¶
Bases:
object
asn1editor.wxPython.WxPythonComplexViews module¶
asn1editor.wxPython.WxPythonViewFactory module¶
- class asn1editor.wxPython.WxPythonViewFactory.WxPythonViewFactory(window: ScrolledWindow, labels: Labels)¶
Bases:
AbstractViewFactory- get_bitstring_view(type_info: TypeInfo, number_of_bits: int, named_bits: List[Tuple[str, int]]) 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_list_view(type_info: TypeInfo, minimum: int, maximum: int) Tuple[ListView, ValueInterface, OptionalInterface]¶
- get_number_view(type_info: TypeInfo, minimum: int | float | None, maximum: int | float | None, float_: bool) Tuple[AbstractView, ValueInterface, OptionalInterface]¶
- get_text_view(type_info: TypeInfo, text: str) AbstractView¶
- get_time_view(type_info: TypeInfo) Tuple[AbstractView, ValueInterface, OptionalInterface]¶
asn1editor.wxPython.WxPythonViews module¶
Module contents¶
- class asn1editor.wxPython.MainWindow(plugins: List[Plugin] | None = None, type_augmenter: TypeAugmenter | None = None, title='ASN.1 editor 0.8.0', enable_load_last=True)¶
Bases:
Frame,PluginInterface- choice_entry(message: str, caption: str, choices: List[str], default: str | None = None) str | None¶
Queries the user for a choice of values.
@param message: Message to show to the user @param caption: Message box caption @param choices: List of strings for the user to choose from @param default: Default selection
@return: Selected string, None if cancelled
- close(e: Event)¶
- dir_picker(message: str) str | None¶
Opens a dir picker where the user can choose a directory name and returns this chosen name.
@param message: Message to show in the dir picker
@return: Selected directory, None if cancelled
- encode_data(codec: str) bytes¶
Encodes the data currently edited in the editor window with an ASN.1 codec.
@param codec: Codec to use for encoding (reference asn1tools which ones are supported)
@return: Encoded data
- file_picker(message: str, wildcard: str, open_: bool) str | None¶
Opens a file picker where the user can choose a file name and returns this chosen name.
@param message: Message to show in the file picker @param wildcard: Wildcards to offer the user in order to help him choose the correct file types @param open_: Flag if the dialog shall be an open dialog (True) or a save dialog (false)
@return: Selected file, None if cancelled
- get_settings() dict¶
Get a settings dictionary for a plugin to store persistent data
@return: Settings dict
- get_spec(codec: str)¶
@param codec: Codec to use (reference asn1tools which ones are supported)
@return: The compiled ASN.1 specification as an object defined by asn1tools.
- get_spec_filename() str¶
@return: The file name of the ASN.1 specification file currently loaded.
- get_typename() str¶
@return: The name of the currently used type name in the editor.
- load_data_from_file(file_name: str)¶
- load_spec(file_name: str | None, type_name: str | None = None) bool¶
Loads an ASN.1 specification in the editor.
@param file_name: File name of the ASN.1 specification @param type_name: Optional type name indication. Format: [Module name].[Type name]
@return: True if data was loaded successfully
- save_data_to_file(file_name: str)¶
- show_data(data: bytes, codec: str)¶
Decodes and shows data from an ASN.1 encoded byte stream in the editor.
@param data: Byte stream with ASN.1 encoded data @param codec: Codec to use for decoding (reference asn1tools which ones are supported)
- show_message(message: str, caption: str, message_type: MessageType) bool¶
Shows a status message.
@param message: Message to show to the user @param caption: Message box caption @param message_type: Type of message box
@return: If type is a question, True means yes and False means No
- show_progress(message: str, caption: str, max_progress: int | None = None)¶
Shows a progress window
@param message: Message to show to the user @param caption: Message box caption @param max_progress: Maximum progress value
- show_status(message: str)¶
Shows a status message.
@param message: Message to show to the user
- text_entry(message: str, default: str | None = None) str | None¶
Queries a text from the user.
@param message: Message to show to the user @param default: Default value for the text entry
@return: Entered text, None if cancelled
- update_progress(message: str | None = None, close: bool = False, progress: int | None = None) bool¶
Updates a shown progress window
@param message: Updated message to show to the user, optional @param close: If set, window is closed, optional @param progress: Progress to show, if none, an indeterminate process is shown, optional
@return: False if progress window has been canceled, otherwise True