GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
Generic class where to store settings. More...
Public Member Functions | |
def | __init__ |
def | ReadSettingsFile |
Reads settings file (mapset, location, gisdbase) More... | |
def | SaveToFile |
Save settings to the file. More... | |
def | Get |
Get value by key/subkey. More... | |
def | Set |
Set value of key/subkey. More... | |
def | Append |
Set value of key/subkey. More... | |
def | GetDefaultSettings |
Get default user settings. More... | |
def | Reset |
Reset to default settings. More... | |
Data Fields | |
filePath | |
sep | |
userSettings | |
locs | |
defaultSettings | |
internalSettings | |
Generic class where to store settings.
Definition at line 32 of file settings.py.
def settings.Settings.__init__ | ( | self | ) |
Definition at line 34 of file settings.py.
def settings.Settings.Append | ( | self, | |
dict, | |||
group, | |||
key, | |||
subkey, | |||
value | |||
) |
Set value of key/subkey.
Create group/key/subkey if not exists
dict | settings dictionary to use |
group | settings group |
key | key |
subkey | subkey (value or list) |
value | value |
Definition at line 982 of file settings.py.
References dialogs.type.
Referenced by manager.GCPList.AddGCPItem(), and settings.Settings.ReadSettingsFile().
def settings.Settings.Get | ( | self, | |
group, | |||
key = None , |
|||
subkey = None , |
|||
internal = False |
|||
) |
Get value by key/subkey.
Raise KeyError if key is not found
group | settings group |
key | (value, None) |
subkey | (value, list or None) |
internal | use internal settings instead |
Definition at line 917 of file settings.py.
References settings.Settings.internalSettings, dialogs.type, and settings.Settings.userSettings.
Referenced by settings.Settings.ReadSettingsFile().
def settings.Settings.GetDefaultSettings | ( | self | ) |
Get default user settings.
Definition at line 1015 of file settings.py.
References settings.Settings.defaultSettings.
def settings.Settings.ReadSettingsFile | ( | self, | |
settings = None |
|||
) |
Reads settings file (mapset, location, gisdbase)
Definition at line 769 of file settings.py.
References settings.Settings._parseValue(), settings.Settings._readFile(), settings.Settings.Append(), settings.Settings.filePath, settings.Settings.Get(), settings.Settings.sep, and settings.Settings.userSettings.
def settings.Settings.Reset | ( | self, | |
key = None |
|||
) |
Reset to default settings.
key in settings dict (None for all keys)
Definition at line 1019 of file settings.py.
References settings.Settings.defaultSettings, and settings.Settings.userSettings.
def settings.Settings.SaveToFile | ( | self, | |
settings = None |
|||
) |
Save settings to the file.
Definition at line 835 of file settings.py.
References settings.Settings._parseValue(), settings.Settings.filePath, utils.GetSettingsPath(), tools.range, settings.Settings.sep, dialogs.type, and settings.Settings.userSettings.
def settings.Settings.Set | ( | self, | |
group, | |||
value, | |||
key = None , |
|||
subkey = None , |
|||
internal = False |
|||
) |
Set value of key/subkey.
Raise KeyError if group/key is not found
group | settings group |
key | key (value, None) |
subkey | subkey (value, list or None) |
value | value |
internal | use internal settings instead |
Definition at line 951 of file settings.py.
References settings.Settings.internalSettings, dialogs.type, and settings.Settings.userSettings.
settings.Settings.defaultSettings |
Definition at line 79 of file settings.py.
Referenced by settings.Settings.GetDefaultSettings(), and settings.Settings.Reset().
settings.Settings.filePath |
Definition at line 36 of file settings.py.
Referenced by settings.Settings.ReadSettingsFile(), and settings.Settings.SaveToFile().
settings.Settings.internalSettings |
Definition at line 687 of file settings.py.
Referenced by settings.Settings.Get(), and settings.Settings.Set().
settings.Settings.locs |
Definition at line 60 of file settings.py.
settings.Settings.sep |
Definition at line 39 of file settings.py.
Referenced by settings.Settings.ReadSettingsFile(), and settings.Settings.SaveToFile().
settings.Settings.userSettings |
Definition at line 45 of file settings.py.
Referenced by settings.Settings.Get(), settings.Settings.ReadSettingsFile(), settings.Settings.Reset(), settings.Settings.SaveToFile(), and settings.Settings.Set().