labscript_utils.labconfig

class labscript_utils.labconfig.EnvInterpolation[source]

Interpolation which expands environment variables in values, by post-filtering BasicInterpolation.before_get()

before_get(*args)[source]
class labscript_utils.labconfig.LabConfig(config_path=PosixPath('/home/docs/labscript-suite/labconfig/build-12259364-project-24586-labscript-utils.ini'), required_params=None, defaults=None)[source]
exception NoOptionError(option, section)

A requested option was not found.

exception NoSectionError(section)

Raised when no section matches a requested option.

_abc_impl = <_abc_data object>
labscript_utils.labconfig.load_appconfig(filename)[source]

Load an .ini file and return a dictionary of its contents. All values will be converted to Python objects with ast.literal_eval(). All keys will be lowercase regardless of the written contents on the .ini file.

labscript_utils.labconfig.save_appconfig(filename, data)[source]

Save a dictionary as an ini file. The keys of the dictionary comprise the section names, and the values must themselves be dictionaries for the names and values within each section. All section values will be converted to strings with pprint.pformat().