diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-07-05 23:48:28 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-07-05 23:48:28 +0200 |
commit | bd2d63f8a53b8a646a7da95d2e2c23bf0bde04a3 (patch) | |
tree | 8361e5735318c4f1681246c32c1ed7c6dde04db4 | |
parent | d9cc0aac4da1f0716bfc6cff74acb829128a813d (diff) | |
download | poezio-bd2d63f8a53b8a646a7da95d2e2c23bf0bde04a3.tar.gz poezio-bd2d63f8a53b8a646a7da95d2e2c23bf0bde04a3.tar.bz2 poezio-bd2d63f8a53b8a646a7da95d2e2c23bf0bde04a3.tar.xz poezio-bd2d63f8a53b8a646a7da95d2e2c23bf0bde04a3.zip |
Check that all needed config sections are there at startup, and create them if not
-rw-r--r-- | src/config.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/config.py b/src/config.py index 9cedcac7..ee37b9a9 100644 --- a/src/config.py +++ b/src/config.py @@ -35,6 +35,10 @@ class Config(RawConfigParser): self.file_name = file_name RawConfigParser.__init__(self, None) RawConfigParser.read(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) def get(self, option, default, section=DEFSECTION): """ |