preferences

This module consists of a single class Preferences, which contains methods that will read and return values for different configuration files.

class Preferences

class microscope_automation.settings.preferences.Preferences(pref_path=None, pref_dict=None, parent_prefs=None)[source]

Reads configuration files and will return Values

get_parent_prefs()[source]

preferences objects that are created from a subset of preferences, keep a reference to the original preferences set.

Input:

none

Output:

parent_prefs: Object of class preferences of preferences that were source for current subset of preferences.

get_pref(name, valid_values=None)[source]

Return value for key ‘name’ in preferences.

Input:

name: string with key name

valid_values: list with allowed values. Throw exception if value is not valid. Default: do not check.

Output:

pref: value for key ‘name’ in preferences

get_pref_as_meta(name)[source]

Return subset of preferences as preferences object.

Input:

name: name of meta data dictionary

Output:

prefsObject: preferences dictionary as preferences object