From 789e5bc499ec140acb832220a5e8c0d2b5c38cf5 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 21 Oct 2015 11:11:57 +0300 Subject: Change name of config file sections for profiles --- NEWS | 2 ++ jtlib/app.py | 7 ++++--- 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) -- cgit v1.2.1