This module allows you to read global settings.

Functions

FunctionParametersReturn ValueDescription
cache_clear()

Clears the global setting cache. Note that saving in the default PLANTA global settings module calls this function
get_global_setting_value(python_id, attribute, value_type=None, default=None)python_id: The Python ID of the global setting to retrieve.
attribute: The attribute of the global setting to retrieve. Valid values are class, alpha120, python_id, parameter, description, template_code and invisible.

value_type: Determines the type the return value should be converted into. For example int or str.
default: The value that should be returned if no global setting with the given python_id exists.
The value of the global setting or the default if the setting does not exist. If no default is given and the setting does not exist, a ValueError is raised.Retrieves a global setting. After retrieving a value once, it will be cached until cache_clear() is called.

Examples

Reading a global setting

from ppms.global_setting import get_global_setting_value

module_id = get_global_setting_value(python_id='profiling_dialog_module', attribute='alpha120', default='009CQE')
PY