4.35. umbra.preferences — Umbra 1.0.9 documentation

# 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)

  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`

    Property for self.__file attribute.

    Returns: | self.__file.
    Return type: | unicode

  `settings`

    Property for self.__settings attribute.

    Returns: | self.__settings.
    Return type: | QSettings

  `defaultSettings`

    Property for self.__defaultSettings attribute.

    Returns: | self.__defaultSettings.
    Return type: | QSettings

  `defaultLayoutsSettings`

    Property for self.__defaultLayoutsSettings attribute.

    Returns: | self.__defaultLayoutsSettings.
    Return type: | QSettings

  `setKey`(section, key, value)

    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)

    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)

    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`()

    Defines the default settings file content.

    Returns: | Method success.
    Return type: | bool

  `setDefaultLayouts`(ignoredLayouts=None)

    Sets the default layouts in the preferences file.

    Parameters: | ignoredLayouts (tuple or list) – Ignored layouts.
    Returns: | Method success.
    Return type: | bool