Commit bd2d63f8 authored by louiz’'s avatar louiz’

Check that all needed config sections are there at startup, and create them if not

parent d9cc0aac
......@@ -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):
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment