prsctrl_gui.utility.config.AppSettings#

class AppSettings(app_language: str = 'en', system_path_append: list[str] = <factory>, console_history_path: str = '<CACHE_DIR>/console-history.txt', data_dir: str | list[str] = '~/prsctrl-gui-data', data_dir_archive: str | list[str] = '~/prsctrl-gui-archive', archive_file_count_threshold: int = 20, data_dir_cache: str = '<CACHE_DIR>/data', reference_data_dir: str | None = None, log_dir: str = '<CACHE_DIR>/logs', plot_max_data_points: int = 20000, plot_update_interval_ms: int = 10, device_auto_reconnect: bool = True, tasklist_path: str = '<CACHE_DIR>/tasklist.yaml', power_switch_autoconnect_devices_timeout_s: int = 10, idle_update_interval_s: int = 10, error_stack_trace: bool = True, error_show_dialog: bool = True, compress_data: bool = True, power_switch_exe: str | None = None, smtp_settings: devctrl.utility.email.SmtpSettings | None = None, sample_db: str = '<CONFIG_DIR>/samples.yaml', power_calibration_db: str = '<CONFIG_DIR>/power-calibration.yaml', setup_info_db: str = '<CONFIG_DIR>/setup-info.yaml', task_preset_dir: str = '<CONFIG_DIR>/task-presets', device_connection_infos_path: str = '<CACHE_DIR>/devices.yaml')[source]#

Bases: SettingsClass

Methods

as_dict

Convenience wrapper for dataclasses.asdict(self)

from_dict

Recursively construct a SettingsClass from a dictionary.

load_yaml

save_yaml

Attributes

__annotations__ = {'app_language': <class 'str'>, 'archive_file_count_threshold': <class 'int'>, 'compress_data': <class 'bool'>, 'console_history_path': <class 'str'>, 'data_dir': str | list[str], 'data_dir_archive': str | list[str], 'data_dir_cache': <class 'str'>, 'device_auto_reconnect': <class 'bool'>, 'device_connection_infos_path': <class 'str'>, 'error_show_dialog': <class 'bool'>, 'error_stack_trace': <class 'bool'>, 'idle_update_interval_s': <class 'int'>, 'log_dir': <class 'str'>, 'plot_max_data_points': <class 'int'>, 'plot_update_interval_ms': <class 'int'>, 'power_calibration_db': <class 'str'>, 'power_switch_autoconnect_devices_timeout_s': <class 'int'>, 'power_switch_exe': typing.Optional[str], 'reference_data_dir': typing.Optional[str], 'sample_db': <class 'str'>, 'setup_info_db': <class 'str'>, 'smtp_settings': typing.Optional[devctrl.utility.email.SmtpSettings], 'system_path_append': list[str], 'task_preset_dir': <class 'str'>, 'tasklist_path': <class 'str'>}#
__dataclass_fields__ = {'app_language': Field(name='app_language',type=<class 'str'>,default='en',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Language of the application. Requires a restart to apply.', 'valid': ['en', 'de', 'de_BV']}),kw_only=False,_field_type=_FIELD), 'archive_file_count_threshold': Field(name='archive_file_count_threshold',type=<class 'int'>,default=20,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Minimum number of measurement points (wavelengths) the data must have to be archived.', 'group': 'data'}),kw_only=False,_field_type=_FIELD), 'compress_data': Field(name='compress_data',type=<class 'bool'>,default=True,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Whether to compress data when saving to disk.', 'group': 'data'}),kw_only=False,_field_type=_FIELD), 'console_history_path': Field(name='console_history_path',type=<class 'str'>,default='<CACHE_DIR>/console-history.txt',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the console command history file.'}),kw_only=False,_field_type=_FIELD), 'data_dir': Field(name='data_dir',type=str | list[str],default='~/prsctrl-gui-data',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Directory/directories to put the final data in after measurements.', 'group': 'data'}),kw_only=False,_field_type=_FIELD), 'data_dir_archive': Field(name='data_dir_archive',type=str | list[str],default='~/prsctrl-gui-archive',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Directory/directories to put the archived data (single-file zip) after measurements.', 'group': 'data'}),kw_only=False,_field_type=_FIELD), 'data_dir_cache': Field(name='data_dir_cache',type=<class 'str'>,default='<CACHE_DIR>/data',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Directory for storing temporary data during measurements.', 'group': 'data'}),kw_only=False,_field_type=_FIELD), 'device_auto_reconnect': Field(name='device_auto_reconnect',type=<class 'bool'>,default=True,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Whether to automatically reconnect to the last connected devices.', 'group': 'device'}),kw_only=False,_field_type=_FIELD), 'device_connection_infos_path': Field(name='device_connection_infos_path',type=<class 'str'>,default='<CACHE_DIR>/devices.yaml',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'File to store which devices were connected.', 'group': 'runtime'}),kw_only=False,_field_type=_FIELD), 'error_show_dialog': Field(name='error_show_dialog',type=<class 'bool'>,default=True,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Whether to show error dialogs when errors occur.', 'group': 'error'}),kw_only=False,_field_type=_FIELD), 'error_stack_trace': Field(name='error_stack_trace',type=<class 'bool'>,default=True,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Whether to show stack traces when errors occur.', 'group': 'error'}),kw_only=False,_field_type=_FIELD), 'idle_update_interval_s': Field(name='idle_update_interval_s',type=<class 'int'>,default=10,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Interval in seconds to check for device connectivity while idling.', 'group': 'device'}),kw_only=False,_field_type=_FIELD), 'log_dir': Field(name='log_dir',type=<class 'str'>,default='<CACHE_DIR>/logs',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Directory for storing log files.'}),kw_only=False,_field_type=_FIELD), 'plot_max_data_points': Field(name='plot_max_data_points',type=<class 'int'>,default=20000,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Maximum number of data points to plot.'}),kw_only=False,_field_type=_FIELD), 'plot_update_interval_ms': Field(name='plot_update_interval_ms',type=<class 'int'>,default=10,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Interval in milliseconds between plot updates.'}),kw_only=False,_field_type=_FIELD), 'power_calibration_db': Field(name='power_calibration_db',type=<class 'str'>,default='<CONFIG_DIR>/power-calibration.yaml',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the pump-power-calibration database file.', 'group': 'runtime'}),kw_only=False,_field_type=_FIELD), 'power_switch_autoconnect_devices_timeout_s': Field(name='power_switch_autoconnect_devices_timeout_s',type=<class 'int'>,default=10,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Timeout in seconds to wait with auto-reconnect after powering on devices.', 'group': 'device'}),kw_only=False,_field_type=_FIELD), 'power_switch_exe': Field(name='power_switch_exe',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the power switch executable.', 'group': 'device'}),kw_only=False,_field_type=_FIELD), 'reference_data_dir': Field(name='reference_data_dir',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Directory containing the DC measurement for calculating absorbance spectra (read-only).', 'group': 'data'}),kw_only=False,_field_type=_FIELD), 'sample_db': Field(name='sample_db',type=<class 'str'>,default='<CONFIG_DIR>/samples.yaml',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the sample database file.', 'group': 'runtime'}),kw_only=False,_field_type=_FIELD), 'setup_info_db': Field(name='setup_info_db',type=<class 'str'>,default='<CONFIG_DIR>/setup-info.yaml',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the setup-info database file.', 'group': 'runtime'}),kw_only=False,_field_type=_FIELD), 'smtp_settings': Field(name='smtp_settings',type=typing.Optional[devctrl.utility.email.SmtpSettings],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'SMTP configuration for sending emails.'}),kw_only=False,_field_type=_FIELD), 'system_path_append': Field(name='system_path_append',type=list[str],default=<dataclasses._MISSING_TYPE object>,default_factory=<class 'list'>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'List of paths to append to the system path.\nThis is required to locate proprietary binaries, like the Bentham SKD or the Cleware Power Switch executable.'}),kw_only=False,_field_type=_FIELD), 'task_preset_dir': Field(name='task_preset_dir',type=<class 'str'>,default='<CONFIG_DIR>/task-presets',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the task-preset directory.', 'group': 'runtime'}),kw_only=False,_field_type=_FIELD), 'tasklist_path': Field(name='tasklist_path',type=<class 'str'>,default='<CACHE_DIR>/tasklist.yaml',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the task list YAML file.'}),kw_only=False,_field_type=_FIELD)}#
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False)#
__dict__ = mappingproxy({'__module__': 'prsctrl_gui.utility.config', '__firstlineno__': 60, '__annotations__': {'app_language': <class 'str'>, 'system_path_append': list[str], 'console_history_path': <class 'str'>, 'data_dir': str | list[str], 'data_dir_archive': str | list[str], 'archive_file_count_threshold': <class 'int'>, 'data_dir_cache': <class 'str'>, 'reference_data_dir': typing.Optional[str], 'log_dir': <class 'str'>, 'plot_max_data_points': <class 'int'>, 'plot_update_interval_ms': <class 'int'>, 'device_auto_reconnect': <class 'bool'>, 'tasklist_path': <class 'str'>, 'power_switch_autoconnect_devices_timeout_s': <class 'int'>, 'idle_update_interval_s': <class 'int'>, 'error_stack_trace': <class 'bool'>, 'error_show_dialog': <class 'bool'>, 'compress_data': <class 'bool'>, 'power_switch_exe': typing.Optional[str], 'smtp_settings': typing.Optional[devctrl.utility.email.SmtpSettings], 'sample_db': <class 'str'>, 'power_calibration_db': <class 'str'>, 'setup_info_db': <class 'str'>, 'task_preset_dir': <class 'str'>, 'device_connection_infos_path': <class 'str'>}, 'app_language': 'en', 'console_history_path': '<CACHE_DIR>/console-history.txt', 'data_dir': '~/prsctrl-gui-data', 'data_dir_archive': '~/prsctrl-gui-archive', 'archive_file_count_threshold': 20, 'data_dir_cache': '<CACHE_DIR>/data', 'reference_data_dir': None, 'log_dir': '<CACHE_DIR>/logs', 'plot_max_data_points': 20000, 'plot_update_interval_ms': 10, 'device_auto_reconnect': True, 'tasklist_path': '<CACHE_DIR>/tasklist.yaml', 'power_switch_autoconnect_devices_timeout_s': 10, 'idle_update_interval_s': 10, 'error_stack_trace': True, 'error_show_dialog': True, 'compress_data': True, 'power_switch_exe': None, 'smtp_settings': None, 'sample_db': '<CONFIG_DIR>/samples.yaml', 'power_calibration_db': '<CONFIG_DIR>/power-calibration.yaml', 'setup_info_db': '<CONFIG_DIR>/setup-info.yaml', 'task_preset_dir': '<CONFIG_DIR>/task-presets', 'device_connection_infos_path': '<CACHE_DIR>/devices.yaml', '__static_attributes__': (), '__doc__': "AppSettings(app_language: str = 'en', system_path_append: list[str] = <factory>, console_history_path: str = '<CACHE_DIR>/console-history.txt', data_dir: str | list[str] = '~/prsctrl-gui-data', data_dir_archive: str | list[str] = '~/prsctrl-gui-archive', archive_file_count_threshold: int = 20, data_dir_cache: str = '<CACHE_DIR>/data', reference_data_dir: Optional[str] = None, log_dir: str = '<CACHE_DIR>/logs', plot_max_data_points: int = 20000, plot_update_interval_ms: int = 10, device_auto_reconnect: bool = True, tasklist_path: str = '<CACHE_DIR>/tasklist.yaml', power_switch_autoconnect_devices_timeout_s: int = 10, idle_update_interval_s: int = 10, error_stack_trace: bool = True, error_show_dialog: bool = True, compress_data: bool = True, power_switch_exe: Optional[str] = None, smtp_settings: Optional[devctrl.utility.email.SmtpSettings] = None, sample_db: str = '<CONFIG_DIR>/samples.yaml', power_calibration_db: str = '<CONFIG_DIR>/power-calibration.yaml', setup_info_db: str = '<CONFIG_DIR>/setup-info.yaml', task_preset_dir: str = '<CONFIG_DIR>/task-presets', device_connection_infos_path: str = '<CACHE_DIR>/devices.yaml')", '__dataclass_params__': _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False), '__dataclass_fields__': {'app_language': Field(name='app_language',type=<class 'str'>,default='en',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Language of the application. Requires a restart to apply.', 'valid': ['en', 'de', 'de_BV']}),kw_only=False,_field_type=_FIELD), 'system_path_append': Field(name='system_path_append',type=list[str],default=<dataclasses._MISSING_TYPE object>,default_factory=<class 'list'>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'List of paths to append to the system path.\nThis is required to locate proprietary binaries, like the Bentham SKD or the Cleware Power Switch executable.'}),kw_only=False,_field_type=_FIELD), 'console_history_path': Field(name='console_history_path',type=<class 'str'>,default='<CACHE_DIR>/console-history.txt',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the console command history file.'}),kw_only=False,_field_type=_FIELD), 'data_dir': Field(name='data_dir',type=str | list[str],default='~/prsctrl-gui-data',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Directory/directories to put the final data in after measurements.', 'group': 'data'}),kw_only=False,_field_type=_FIELD), 'data_dir_archive': Field(name='data_dir_archive',type=str | list[str],default='~/prsctrl-gui-archive',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Directory/directories to put the archived data (single-file zip) after measurements.', 'group': 'data'}),kw_only=False,_field_type=_FIELD), 'archive_file_count_threshold': Field(name='archive_file_count_threshold',type=<class 'int'>,default=20,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Minimum number of measurement points (wavelengths) the data must have to be archived.', 'group': 'data'}),kw_only=False,_field_type=_FIELD), 'data_dir_cache': Field(name='data_dir_cache',type=<class 'str'>,default='<CACHE_DIR>/data',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Directory for storing temporary data during measurements.', 'group': 'data'}),kw_only=False,_field_type=_FIELD), 'reference_data_dir': Field(name='reference_data_dir',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Directory containing the DC measurement for calculating absorbance spectra (read-only).', 'group': 'data'}),kw_only=False,_field_type=_FIELD), 'log_dir': Field(name='log_dir',type=<class 'str'>,default='<CACHE_DIR>/logs',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Directory for storing log files.'}),kw_only=False,_field_type=_FIELD), 'plot_max_data_points': Field(name='plot_max_data_points',type=<class 'int'>,default=20000,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Maximum number of data points to plot.'}),kw_only=False,_field_type=_FIELD), 'plot_update_interval_ms': Field(name='plot_update_interval_ms',type=<class 'int'>,default=10,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Interval in milliseconds between plot updates.'}),kw_only=False,_field_type=_FIELD), 'device_auto_reconnect': Field(name='device_auto_reconnect',type=<class 'bool'>,default=True,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Whether to automatically reconnect to the last connected devices.', 'group': 'device'}),kw_only=False,_field_type=_FIELD), 'tasklist_path': Field(name='tasklist_path',type=<class 'str'>,default='<CACHE_DIR>/tasklist.yaml',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the task list YAML file.'}),kw_only=False,_field_type=_FIELD), 'power_switch_autoconnect_devices_timeout_s': Field(name='power_switch_autoconnect_devices_timeout_s',type=<class 'int'>,default=10,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Timeout in seconds to wait with auto-reconnect after powering on devices.', 'group': 'device'}),kw_only=False,_field_type=_FIELD), 'idle_update_interval_s': Field(name='idle_update_interval_s',type=<class 'int'>,default=10,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Interval in seconds to check for device connectivity while idling.', 'group': 'device'}),kw_only=False,_field_type=_FIELD), 'error_stack_trace': Field(name='error_stack_trace',type=<class 'bool'>,default=True,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Whether to show stack traces when errors occur.', 'group': 'error'}),kw_only=False,_field_type=_FIELD), 'error_show_dialog': Field(name='error_show_dialog',type=<class 'bool'>,default=True,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Whether to show error dialogs when errors occur.', 'group': 'error'}),kw_only=False,_field_type=_FIELD), 'compress_data': Field(name='compress_data',type=<class 'bool'>,default=True,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Whether to compress data when saving to disk.', 'group': 'data'}),kw_only=False,_field_type=_FIELD), 'power_switch_exe': Field(name='power_switch_exe',type=typing.Optional[str],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the power switch executable.', 'group': 'device'}),kw_only=False,_field_type=_FIELD), 'smtp_settings': Field(name='smtp_settings',type=typing.Optional[devctrl.utility.email.SmtpSettings],default=None,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'SMTP configuration for sending emails.'}),kw_only=False,_field_type=_FIELD), 'sample_db': Field(name='sample_db',type=<class 'str'>,default='<CONFIG_DIR>/samples.yaml',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the sample database file.', 'group': 'runtime'}),kw_only=False,_field_type=_FIELD), 'power_calibration_db': Field(name='power_calibration_db',type=<class 'str'>,default='<CONFIG_DIR>/power-calibration.yaml',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the pump-power-calibration database file.', 'group': 'runtime'}),kw_only=False,_field_type=_FIELD), 'setup_info_db': Field(name='setup_info_db',type=<class 'str'>,default='<CONFIG_DIR>/setup-info.yaml',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the setup-info database file.', 'group': 'runtime'}),kw_only=False,_field_type=_FIELD), 'task_preset_dir': Field(name='task_preset_dir',type=<class 'str'>,default='<CONFIG_DIR>/task-presets',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'Path to the task-preset directory.', 'group': 'runtime'}),kw_only=False,_field_type=_FIELD), 'device_connection_infos_path': Field(name='device_connection_infos_path',type=<class 'str'>,default='<CACHE_DIR>/devices.yaml',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'doc': 'File to store which devices were connected.', 'group': 'runtime'}),kw_only=False,_field_type=_FIELD)}, '__replace__': <function _replace>, '__hash__': None, '__init__': <function AppSettings.__init__>, '__repr__': <function AppSettings.__repr__>, '__eq__': <function AppSettings.__eq__>, '__match_args__': ('app_language', 'system_path_append', 'console_history_path', 'data_dir', 'data_dir_archive', 'archive_file_count_threshold', 'data_dir_cache', 'reference_data_dir', 'log_dir', 'plot_max_data_points', 'plot_update_interval_ms', 'device_auto_reconnect', 'tasklist_path', 'power_switch_autoconnect_devices_timeout_s', 'idle_update_interval_s', 'error_stack_trace', 'error_show_dialog', 'compress_data', 'power_switch_exe', 'smtp_settings', 'sample_db', 'power_calibration_db', 'setup_info_db', 'task_preset_dir', 'device_connection_infos_path')})#
__eq__(other)#

Return self==value.

__firstlineno__ = 60#
__hash__ = None#
__init__(app_language: str = 'en', system_path_append: list[str] = <factory>, console_history_path: str = '<CACHE_DIR>/console-history.txt', data_dir: str | list[str] = '~/prsctrl-gui-data', data_dir_archive: str | list[str] = '~/prsctrl-gui-archive', archive_file_count_threshold: int = 20, data_dir_cache: str = '<CACHE_DIR>/data', reference_data_dir: str | None = None, log_dir: str = '<CACHE_DIR>/logs', plot_max_data_points: int = 20000, plot_update_interval_ms: int = 10, device_auto_reconnect: bool = True, tasklist_path: str = '<CACHE_DIR>/tasklist.yaml', power_switch_autoconnect_devices_timeout_s: int = 10, idle_update_interval_s: int = 10, error_stack_trace: bool = True, error_show_dialog: bool = True, compress_data: bool = True, power_switch_exe: str | None = None, smtp_settings: SmtpSettings | None = None, sample_db: str = '<CONFIG_DIR>/samples.yaml', power_calibration_db: str = '<CONFIG_DIR>/power-calibration.yaml', setup_info_db: str = '<CONFIG_DIR>/setup-info.yaml', task_preset_dir: str = '<CONFIG_DIR>/task-presets', device_connection_infos_path: str = '<CACHE_DIR>/devices.yaml') None#
__match_args__ = ('app_language', 'system_path_append', 'console_history_path', 'data_dir', 'data_dir_archive', 'archive_file_count_threshold', 'data_dir_cache', 'reference_data_dir', 'log_dir', 'plot_max_data_points', 'plot_update_interval_ms', 'device_auto_reconnect', 'tasklist_path', 'power_switch_autoconnect_devices_timeout_s', 'idle_update_interval_s', 'error_stack_trace', 'error_show_dialog', 'compress_data', 'power_switch_exe', 'smtp_settings', 'sample_db', 'power_calibration_db', 'setup_info_db', 'task_preset_dir', 'device_connection_infos_path')#
__module__ = 'prsctrl_gui.utility.config'#
__or__(other)#

Merge with another settings class or a dictionary.

__replace__(**changes)#
__repr__()#

Return repr(self).

__static_attributes__ = ()#
__weakref__#

list of weak references to the object

app_language: str = 'en'#
archive_file_count_threshold: int = 20#
as_dict() dict#

Convenience wrapper for dataclasses.asdict(self)

compress_data: bool = True#
console_history_path: str = '<CACHE_DIR>/console-history.txt'#
data_dir: str | list[str] = '~/prsctrl-gui-data'#
data_dir_archive: str | list[str] = '~/prsctrl-gui-archive'#
data_dir_cache: str = '<CACHE_DIR>/data'#
device_auto_reconnect: bool = True#
device_connection_infos_path: str = '<CACHE_DIR>/devices.yaml'#
error_show_dialog: bool = True#
error_stack_trace: bool = True#
classmethod from_dict(data: dict)#

Recursively construct a SettingsClass from a dictionary.

If the value of a field is another SettingsClass, from_dict() will be called for that field as well. Handled are:

  • SettingsClass

  • list[SettingsClass]

  • dict[<any>, SettingsClass]

  • all of the above as Optional (Union with None)

  • a Union with any handled types

Raises:
  • ValueError – If data contains a value that has the wrong type for the field of cls (ONLY if the type is a subclass of SettingsClass! Other types are not enforced)

  • KeyError – If data contains a key that is not a field name of cls

idle_update_interval_s: int = 10#
classmethod load_yaml(yaml_path: str, loader=<class 'yaml.loader.Loader'>)#
log_dir: str = '<CACHE_DIR>/logs'#
plot_max_data_points: int = 20000#
plot_update_interval_ms: int = 10#
power_calibration_db: str = '<CONFIG_DIR>/power-calibration.yaml'#
power_switch_autoconnect_devices_timeout_s: int = 10#
power_switch_exe: str | None = None#
reference_data_dir: str | None = None#
sample_db: str = '<CONFIG_DIR>/samples.yaml'#
save_yaml(yaml_path: str)#
setup_info_db: str = '<CONFIG_DIR>/setup-info.yaml'#
smtp_settings: SmtpSettings | None = None#
system_path_append: list[str]#
task_preset_dir: str = '<CONFIG_DIR>/task-presets'#
tasklist_path: str = '<CACHE_DIR>/tasklist.yaml'#