keyconfparser: Add empty sections.

This commit is contained in:
Florian Bruhin 2014-09-09 22:38:14 +02:00
parent 95d8091205
commit 277dab4069

View File

@ -114,9 +114,12 @@ class KeyConfigParser:
"""Load the built-in default keybindings.""" """Load the built-in default keybindings."""
for sectname, sect in configdata.KEY_DATA.items(): for sectname, sect in configdata.KEY_DATA.items():
sectname = self._normalize_sectname(sectname) sectname = self._normalize_sectname(sectname)
for command, keychains in sect.items(): if not sect:
for e in keychains: self.keybindings[sectname] = collections.OrderedDict()
self._add_binding(sectname, e, command) else:
for command, keychains in sect.items():
for e in keychains:
self._add_binding(sectname, e, command)
def _read(self): def _read(self):
"""Read the config file from disk and parse it.""" """Read the config file from disk and parse it."""