diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-02-21 15:14:28 +0000 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-02-21 15:14:28 +0000 |
commit | b72a83b79a3616a0c451143f66332876929aee2b (patch) | |
tree | 285eb022fe671d23126a7f4530d6c4a66a92543a /pykolab/conf/__init__.py | |
parent | 8a85a51fb60d01495ed470bd1e545d98c05b1299 (diff) | |
download | pykolab-b72a83b79a3616a0c451143f66332876929aee2b.tar.gz |
Update pykolab including:
- a plugin system,
- some example plugins,
- a working kolab daemon,
- copyright updates,
- auth/ldap/ abstraction so auth/sql/ can be plugged in,
- and more.
Diffstat (limited to 'pykolab/conf/__init__.py')
-rw-r--r-- | pykolab/conf/__init__.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pykolab/conf/__init__.py b/pykolab/conf/__init__.py index fb37a8c..12d12e1 100644 --- a/pykolab/conf/__init__.py +++ b/pykolab/conf/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2010 Kolab Systems AG (http://www.kolabsys.com) +# Copyright 2010-2011 Kolab Systems AG (http://www.kolabsys.com) # # Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen a kolabsys.com> # @@ -168,6 +168,8 @@ class Conf(object): # Other then default? if not self.cli_options.config_file == self.defaults.config_file: self.config_file = self.cli_options.config_file + else: + self.config_file = self.defaults.config_file config = self.check_config() self.load_config(config) @@ -422,6 +424,13 @@ class Conf(object): self.log.debug(_("Setting %s to %r (from the default values for CLI options)") %(option, self.parser._long_opt[long_opt].default), level=9) setattr(self,option,self.parser._long_opt[long_opt].default) + def get_raw(self, section, key): + if not self.cfg_parser: + self.read_config() + + if self.cfg_parser.has_option(section, key): + return self.cfg_parser.get(section,key, 1) + def get(self, section, key): if not self.cfg_parser: self.read_config() @@ -429,7 +438,7 @@ class Conf(object): if self.cfg_parser.has_option(section, key): return self.cfg_parser.get(section,key) else: - self.log.warning(_("Option does not exist in config file, pulling from defaults")) + self.log.warning(_("Option %s/%s does not exist in config file %s, pulling from defaults") %(section, key, self.config_file)) if hasattr(self.defaults, "%s_%s" %(section,key)): return getattr(self.defaults, "%s_%s" %(section,key)) elif hasattr(self.defaults, "%s" %(section)): |