Try to fix qute://settings

This commit is contained in:
Florian Bruhin 2017-06-15 19:05:55 +02:00
parent 5414744439
commit 4c2f65819b
2 changed files with 11 additions and 4 deletions

View File

@ -471,7 +471,7 @@ def qute_settings(url):
if url.path() == '/set':
return _qute_settings_set(url)
config_getter = config.instance.get # FIXME to_str
html = jinja.render('settings.html', title='settings',
configdata=configdata, confget=config_getter)
configdata=configdata,
confget=config.instance.get_str)
return 'text/html', html

View File

@ -124,10 +124,17 @@ class NewConfigManager(QObject):
def get(self, option):
try:
value = self.options[option]
opt = self.options[option]
except KeyError:
raise configexc.NoOptionError(option)
return value.typ.to_py(value.default)
return opt.typ.to_py(opt.default)
def get_str(self, option):
try:
opt = self.options[option]
except KeyError:
raise configexc.NoOptionError(option)
return opt.typ.to_str(opt.default)
def set(self, option, value):
raise configexc.Error("Setting doesn't work yet!")