4.35. umbra.preferences
preferences.py
- Platform:
- Windows, Linux, Mac Os X.
- Description:
- Defines the Preferences class.
Others:
4.35.1. Module Attributes
-
umbra.preferences.LOGGER
4.35.2. Classes
-
class umbra.preferences.Preferences(file=None)[source]
Bases: object
Defines methods to manipulate Application preferences / settings.
Those are stored and retrieved using a
QSettings class.
Initializes the class.
Parameters: | file (unicode) – Current preferences file path. |
-
file[source]
Property for self.__file attribute.
Returns: | self.__file. |
Return type: | unicode |
-
settings[source]
Property for self.__settings attribute.
Returns: | self.__settings. |
Return type: | QSettings |
-
defaultSettings[source]
Property for self.__defaultSettings attribute.
Returns: | self.__defaultSettings. |
Return type: | QSettings |
-
defaultLayoutsSettings[source]
Property for self.__defaultLayoutsSettings attribute.
Returns: | self.__defaultLayoutsSettings. |
Return type: | QSettings |
-
setKey(section, key, value)[source]
Stores given key in settings file.
Parameters: |
- section (unicode) – Current section to save the key into.
- key (unicode) – Current key to save.
- value (object) – Current key value to save.
|
-
getKey(section, key)[source]
Gets key value from settings file.
Parameters: |
- section (unicode) – Current section to retrieve key from.
- key (unicode) – Current key to retrieve.
|
Returns: | Current key value.
|
Return type: | object
|
-
keyExists(section, key)[source]
Checks if given key exists.
Parameters: |
- section (unicode) – Current section to check key in.
- key (unicode) – Current key to check.
|
Returns: | Key existence.
|
Return type: | bool
|
-
setDefaultPreferences()[source]
Defines the default settings file content.
Returns: | Method success. |
Return type: | bool |
-
setDefaultLayouts(ignoredLayouts=None)[source]
Sets the default layouts in the preferences file.
Parameters: | ignoredLayouts (tuple or list) – Ignored layouts. |
Returns: | Method success. |
Return type: | bool |