Options Manager#
- class ignis.options.OptionsManager(file: str | None = None)#
Bases:
OptionsGroup
.This is the top-level class in the option structure. It provides support for loading and saving options to a file.
- Parameters:
file (
str
|None
, default:None
) -- The path to the file used for saving and loading options. Cannot be changed after initialization.
The standard option structure must follow this format:
from ignis.options_manager import OptionsManager, OptionsGroup class SomeOptions(OptionsManager): def __init__(self): super().__init__(file="PATH/TO/FILE") class Subgroup1(OptionsGroup): option1: bool = False option2: int = 5000 class SomeSubgroup(OptionsGroup): example_option: str | None = get_something...() test: str = "%Y-%m-%d_%H-%M-%S.mp4" subgroup1 = Subgroup1() some_subgroup = SomeSubgroup() some_options = SomeOptions()
- class ignis.options.OptionsGroup(*args: Any, **kwargs: Any)#
An options group.
- changed(*args)#
Signal
Emitted when an option of this group has changed
- Parameters:
option_name -- The name of the option.
- subgroup_changed(*args)#
Signal
Emitted when an option of a subgroup has changed
- Parameters:
subgroup_name -- The name of the subgroup.
option_name -- The name of the option.
- connect_option(option_name: str, callback: Callable, *args) None #
Connect an option change event to the specified callback.
This method serves as a replacement for the
notify
signal, as options are simple Python properties, not GObject properties.- Parameters:
- Return type:
Any
*args
will be passed to thecallback
.