Work around binding =

This commit is contained in:
Florian Bruhin 2014-05-11 21:55:41 +02:00
parent fd9f801cab
commit 195c7d6ef7
3 changed files with 6 additions and 2 deletions

1
TODO
View File

@ -1,7 +1,6 @@
Before 0.1
==========
- Don't use configaparser for keys because we can't use = (to bind zoom)
- Check FIXMEs
- Manpage
- Website

View File

@ -187,6 +187,8 @@ class ConfigManager(QObject):
for c in self.KEY_ESCAPE:
if optname.startswith(c):
optname = optname.replace(c, self.ESCAPE_CHAR + c, 1)
# configparser can't handle = in keys :(
optname = optname.replace('=', '<eq>')
keyval = '{} = {}'.format(optname, value)
lines.append(keyval)
return lines
@ -203,6 +205,8 @@ class ConfigManager(QObject):
for k, v in cp[sectname].items():
if k.startswith(self.ESCAPE_CHAR):
k = k[1:]
# configparser can't handle = in keys :(
k = k.replace('<eq>', '=')
try:
self.set('conf', sectname, k, v)
except ValidationError as e:

View File

@ -59,6 +59,7 @@ FIRST_COMMENT = r"""
# You will need to escape the following values:
# - # at the start of the line (at the first position of the key) (\#)
# - $ in a value ($$)
# - = in a value as <eq>
"""
@ -595,7 +596,7 @@ DATA = OrderedDict([
('sk', 'set keybind'),
('-', 'zoomout'),
('+', 'zoomin'),
#('=', 'zoom'),
('=', 'zoom'),
('[[', 'prevpage'),
(']]', 'nextpage'),
('{{', 'tabprevpage'),