Make :set work correctly

This commit is contained in:
Florian Bruhin 2014-04-10 07:09:12 +02:00
parent e9317f807b
commit a0a8f5d025
2 changed files with 4 additions and 8 deletions

1
TODO
View File

@ -2,7 +2,6 @@ New config TODO
=============== ===============
- Changing models is awfully slow - Changing models is awfully slow
- Add correctly working :get and :set commands
- Implement different layers of config options correctly, not only default. - Implement different layers of config options correctly, not only default.
Bugs Bugs

View File

@ -219,13 +219,10 @@ class Config:
if value: if value:
value = self._interpolation.before_set(self, section, option, value = self._interpolation.before_set(self, section, option,
value) value)
if not section or section == self.default_section: try:
sectdict = self._defaults sectdict = self.config[section]
else: except KeyError:
try: raise NoSectionError(section)
sectdict = self._sections[section]
except KeyError:
raise NoSectionError(section)
sectdict[self.optionxform(option)] = value sectdict[self.optionxform(option)] = value
def save(self): def save(self):