Package Settings
This module defines class for handling and storing package settings.
-
class PackageSettings(pkg, rcfile=None, logger=None)[source]
A class for managing package settings. Settings are saved in user’s
home director. When settings are changed by the users, the changes are
automatically saved. Settings are stored in a dict instance.
The dictionary is pickled in user’s home directory for permanent storage.
rcfile is the filename for pickled settings dictionary, and by
default is set to .pkgrc.
-
get(key, default=None)[source]
Return value corresponding to specified key, or default if key
is not found.
-
load()[source]
Load settings by unpickling the settings dictionary.
-
pop(key, default=None)[source]
Remove specified key and return corresponding value. If key is
not found, default is returned.
-
save(backup=False)[source]
Save settings by pickling the settings dictionary.
-
update(*args, **kwargs)[source]
Update settings dictionary.
-
getPackagePath()[source]
Return package path.
-
setPackagePath(path)[source]
Set package path.