trspectrometer.configuration module

Handle loading, storing, saving, and default values for program settings.

trspectrometer.configuration.add_defaults(defaultsdict)[source]

Update the current configuration using the provided dictionary of default values.

Existing entries in the current configuration will not be overwritten. This allows adding any missing default values to the configuration without overwriting values which may already exist.

Parameters:

defaultsdict – Dictionary of default configuration values.

trspectrometer.configuration.plugin_dirs()[source]

Return the list of plugin directories from configuration file, but also append the built-in plugin directory.

Returns:

List of configured plugin directories.

trspectrometer.configuration.read(reset=False)[source]

Read and update configuration from the configuration file.

If reset=True the current configuration will be reset prior to reading the file, otherwise the configuration will be preserved and only be updated with any values stored in the file.

Parameters:

reset – Reset current configuration before reading file.

trspectrometer.configuration.set_defaults()[source]
trspectrometer.configuration.update(newdict)[source]

Update the current configuration using the provided dictionary.

Any existing configuration entries will be overwritten by the new values.

Parameters:

newdict – Dictionary of updated configuration values.

trspectrometer.configuration.write()[source]

Write the current configuration out the the configuration file.

trspectrometer.configuration.configfile = '/home/docs/.config/trspectrometer/trspectrometer.toml'

Path to the configuration file.

trspectrometer.configuration.data = {'directories': {'data': '/home/docs', 'plugins': []}, 'hardware': {'init_hardware': True, 'laser_reprate': 1000}, 'plugins': {'load': ['aligncam', 'delay', 'chopper', 'detector', 'interface', 'acquisition', 'scope']}, 'rawdata': {'units': {'data': 'ΔA', 'time': 'ps', 'wavelength': 'nm'}}}

Data structure holding the configuration as a TOMLDocument.

trspectrometer.configuration.mainwindow = None

Reference to the main window class instance.