diff options
author | Balint Seeber <balint@ettus.com> | 2014-04-04 09:32:42 -0700 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2014-04-09 17:42:05 +0200 |
commit | 0b69cb314c4e63dc82bd971551cb2cdbae12a302 (patch) | |
tree | 8866439fc3d4c10a2c6a8a17ec89b3ebbd51368f /grc/gui/Preferences.py | |
parent | cd06fdc9372bb2489cc7a455b75cef445343296d (diff) |
grc: honour order of block paths, print them out on startup, override hier block and pref file path with GRC_HIER_PATH & GRC_PREFS_PATH
Diffstat (limited to 'grc/gui/Preferences.py')
-rw-r--r-- | grc/gui/Preferences.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/grc/gui/Preferences.py b/grc/gui/Preferences.py index c315436cae..061bda9c05 100644 --- a/grc/gui/Preferences.py +++ b/grc/gui/Preferences.py @@ -24,7 +24,7 @@ _platform = None _config_parser = ConfigParser.ConfigParser() def file_extension(): return '.'+_platform.get_key() -def _prefs_file(): return os.path.join(os.path.expanduser('~'), file_extension()) +def _prefs_file(): return os.environ.get('GRC_PREFS_PATH', os.path.join(os.path.expanduser('~'), file_extension())) def load(platform): global _platform @@ -32,9 +32,11 @@ def load(platform): #create sections _config_parser.add_section('main') _config_parser.add_section('files_open') + print "Reading preferences from:", _prefs_file() try: _config_parser.read(_prefs_file()) except: pass def save(): + print "Writing preferences to:", _prefs_file() try: _config_parser.write(open(_prefs_file(), 'w')) except: pass |