summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-10-21 11:11:57 +0300
committerLars Wirzenius <liw@liw.fi>2015-10-21 11:11:57 +0300
commit789e5bc499ec140acb832220a5e8c0d2b5c38cf5 (patch)
treea174f53cb52b83bd32cfd52635a571f706338183
parent08b3960093c5fdcf8f3132f144bd1cbf14b55a10 (diff)
downloadjt-789e5bc499ec140acb832220a5e8c0d2b5c38cf5.tar.gz
Change name of config file sections for profiles
-rw-r--r--NEWS2
-rw-r--r--jtlib/app.py7
2 files changed, 6 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 70bb337..315518e 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ Version 0.11, released UNRELEASED
---------------------------------
* Fix merging of string-list type settings from a profile.
+* Config file sections for profiles must now be "profile foo", not
+ just "foo".
Version 0.10, released 2015-10-17
---------------------------------
diff --git a/jtlib/app.py b/jtlib/app.py
index c2078b7..ad0d7a3 100644
--- a/jtlib/app.py
+++ b/jtlib/app.py
@@ -84,15 +84,16 @@ class JournalTool(cliapp.Application):
def merge_profile(self):
profile = self.settings['profile']
if profile:
+ section = 'profile %s' % profile
cp = self.settings.as_cp()
- if profile not in cp.sections():
+ if section not in cp.sections():
raise cliapp.AppException('Unknown profile %s' % profile)
- for key in cp.options(profile):
+ for key in cp.options(section):
if key not in self.settings:
raise cliapp.AppException(
'Profile %s uses unknown setting %s' %
(profile, key))
- value = cp.get(profile, key)
+ value = cp.get(section, key)
self.settings.set_from_raw_string(
'profile %s' % profile, key, value)