GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
settings.Settings Class Reference

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
 

Detailed Description

Generic class where to store settings.

Definition at line 32 of file settings.py.

Constructor & Destructor Documentation

def settings.Settings.__init__ (   self)

Definition at line 34 of file settings.py.

Member Function Documentation

def settings.Settings.Append (   self,
  dict,
  group,
  key,
  subkey,
  value 
)

Set value of key/subkey.

Create group/key/subkey if not exists

Parameters
dictsettings dictionary to use
groupsettings group
keykey
subkeysubkey (value or list)
valuevalue

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

Parameters
groupsettings group
key(value, None)
subkey(value, list or None)
internaluse internal settings instead
Returns
value

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

Parameters
groupsettings group
keykey (value, None)
subkeysubkey (value, list or None)
valuevalue
internaluse internal settings instead

Definition at line 951 of file settings.py.

References settings.Settings.internalSettings, dialogs.type, and settings.Settings.userSettings.

Field Documentation

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


The documentation for this class was generated from the following file: