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."""
for sectname, sect in configdata.KEY_DATA.items():
sectname = self._normalize_sectname(sectname)
for command, keychains in sect.items():
for e in keychains:
self._add_binding(sectname, e, command)
if not sect:
self.keybindings[sectname] = collections.OrderedDict()
else:
for command, keychains in sect.items():
for e in keychains:
self._add_binding(sectname, e, command)
def _read(self):
"""Read the config file from disk and parse it."""