|
Share and Money Management 0.18devel
|
The configuration module handles configuration entries stored in a file. More...
Functions | |
| def | init (filename=None) |
| Initialize the class and load all values. More... | |
| def | set_item (key, value) |
| Set a configuration value. More... | |
| def | get_item (key) |
| Returns a configuration value. More... | |
| def | load () |
| Load the configuration from a file. More... | |
| def | save (force=False, saveAll=False) |
| Store configuration into a file. More... | |
Variables | |
| dictionary | config = {} |
| Contains the current configuration items. More... | |
| string | config_file = "" |
| File name of the configuration file. More... | |
| string | config_file_win = "./smmgui.ini" |
| File name of the configuration file on Windows platforms. More... | |
| string | config_file_unix = "./smmguirc" |
| File name of the configuration file on Unix platforms. More... | |
| dictionary | config_defaults = {} |
| Default configuration settings. More... | |
| bool | has_changed = False |
| Indicate changes at the configuration items. More... | |
| string | header |
| Small header added to every written config file. More... | |
| py_version = sys.version.split()[0] | |
| Python version. More... | |
| string | wx_version = "not_set" |
| wxPython version More... | |
| string | platform = "not_set" |
| Current platform (mostly wx.Platform) More... | |
| string | list_sep = " " |
| Separator to converts lists into strings and back. More... | |
The configuration module handles configuration entries stored in a file.
| def gui.config.get_item | ( | key | ) |
Returns a configuration value.
| ValueError | If the requested key is unknown |
| def gui.config.init | ( | filename = None | ) |
Initialize the class and load all values.
| filename | Name of the configuration file or None to use default settings |
References gui.config.load(), and gui.config.set_item().
| def gui.config.load | ( | ) |
Load the configuration from a file.
| TypeError | If the type of the configuration item is unknown |
Referenced by gui.config.init().
| def gui.config.save | ( | force = False, |
|
saveAll = False |
|||
| ) |
Store configuration into a file.
The unchanged values will not write to the configuration file.
| force | Forces writing to disk also if the configuration is unchanged |
| saveAll | Save all configuration items, false means to save the changed items only |
| def gui.config.set_item | ( | key, | |
| value | |||
| ) |
Set a configuration value.
| key | Configuration key section/option |
| value | New value |
| TypeError | If item's type doesn't fit the excepted type |
| ValueError | For unknown configuration items |
Referenced by gui.config.init().
| gui.config.config = {} |
Contains the current configuration items.
| dictionary gui.config.config_defaults = {} |
Default configuration settings.
| string gui.config.config_file = "" |
File name of the configuration file.
| string gui.config.config_file_unix = "./smmguirc" |
File name of the configuration file on Unix platforms.
| string gui.config.config_file_win = "./smmgui.ini" |
File name of the configuration file on Windows platforms.
| gui.config.has_changed = False |
Indicate changes at the configuration items.
| string gui.config.header |
Small header added to every written config file.
Every header line should start with # to mark it as a comment line.
| string gui.config.list_sep = " " |
Separator to converts lists into strings and back.
| string gui.config.platform = "not_set" |
Current platform (mostly wx.Platform)
| gui.config.py_version = sys.version.split()[0] |
Python version.
| string gui.config.wx_version = "not_set" |
wxPython version