summaryrefslogtreecommitdiff
path: root/src/config.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-12-10 23:12:17 +0100
committermathieui <mathieui@mathieui.net>2014-12-10 23:12:17 +0100
commit003c28e953ccce64523946c3d3d6578c436c9f3e (patch)
tree5138d1c6ecd8923219c43bb8be84b847d2e81914 /src/config.py
parent4c7a470dc87686b724d9cfd67b6cb365156021ce (diff)
downloadpoezio-003c28e953ccce64523946c3d3d6578c436c9f3e.tar.gz
poezio-003c28e953ccce64523946c3d3d6578c436c9f3e.tar.bz2
poezio-003c28e953ccce64523946c3d3d6578c436c9f3e.tar.xz
poezio-003c28e953ccce64523946c3d3d6578c436c9f3e.zip
Allow the plugins to use a default configuration too
through overloading the class variable default_config. also fix a bug that would add meaningless sections to plugin configurations.
Diffstat (limited to 'src/config.py')
-rw-r--r--src/config.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/config.py b/src/config.py
index eaadb9d6..390fe7f1 100644
--- a/src/config.py
+++ b/src/config.py
@@ -153,9 +153,11 @@ class Config(RawConfigParser):
except TypeError: # python < 3.2 sucks
RawConfigParser.read(self, self.file_name)
# Check config integrity and fix it if it’s wrong
- for section in ('bindings', 'var'):
- if not self.has_section(section):
- self.add_section(section)
+ # only when the object is the main config
+ if self.__class__ is Config:
+ for section in ('bindings', 'var'):
+ if not self.has_section(section):
+ self.add_section(section)
def get(self, option, default=None, section=DEFSECTION):
"""