Work around binding =
This commit is contained in:
parent
fd9f801cab
commit
195c7d6ef7
1
TODO
1
TODO
@ -1,7 +1,6 @@
|
|||||||
Before 0.1
|
Before 0.1
|
||||||
==========
|
==========
|
||||||
|
|
||||||
- Don't use configaparser for keys because we can't use = (to bind zoom)
|
|
||||||
- Check FIXMEs
|
- Check FIXMEs
|
||||||
- Manpage
|
- Manpage
|
||||||
- Website
|
- Website
|
||||||
|
@ -187,6 +187,8 @@ class ConfigManager(QObject):
|
|||||||
for c in self.KEY_ESCAPE:
|
for c in self.KEY_ESCAPE:
|
||||||
if optname.startswith(c):
|
if optname.startswith(c):
|
||||||
optname = optname.replace(c, self.ESCAPE_CHAR + c, 1)
|
optname = optname.replace(c, self.ESCAPE_CHAR + c, 1)
|
||||||
|
# configparser can't handle = in keys :(
|
||||||
|
optname = optname.replace('=', '<eq>')
|
||||||
keyval = '{} = {}'.format(optname, value)
|
keyval = '{} = {}'.format(optname, value)
|
||||||
lines.append(keyval)
|
lines.append(keyval)
|
||||||
return lines
|
return lines
|
||||||
@ -203,6 +205,8 @@ class ConfigManager(QObject):
|
|||||||
for k, v in cp[sectname].items():
|
for k, v in cp[sectname].items():
|
||||||
if k.startswith(self.ESCAPE_CHAR):
|
if k.startswith(self.ESCAPE_CHAR):
|
||||||
k = k[1:]
|
k = k[1:]
|
||||||
|
# configparser can't handle = in keys :(
|
||||||
|
k = k.replace('<eq>', '=')
|
||||||
try:
|
try:
|
||||||
self.set('conf', sectname, k, v)
|
self.set('conf', sectname, k, v)
|
||||||
except ValidationError as e:
|
except ValidationError as e:
|
||||||
|
@ -59,6 +59,7 @@ FIRST_COMMENT = r"""
|
|||||||
# You will need to escape the following values:
|
# You will need to escape the following values:
|
||||||
# - # at the start of the line (at the first position of the key) (\#)
|
# - # at the start of the line (at the first position of the key) (\#)
|
||||||
# - $ in a value ($$)
|
# - $ in a value ($$)
|
||||||
|
# - = in a value as <eq>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@ -595,7 +596,7 @@ DATA = OrderedDict([
|
|||||||
('sk', 'set keybind'),
|
('sk', 'set keybind'),
|
||||||
('-', 'zoomout'),
|
('-', 'zoomout'),
|
||||||
('+', 'zoomin'),
|
('+', 'zoomin'),
|
||||||
#('=', 'zoom'),
|
('=', 'zoom'),
|
||||||
('[[', 'prevpage'),
|
('[[', 'prevpage'),
|
||||||
(']]', 'nextpage'),
|
(']]', 'nextpage'),
|
||||||
('{{', 'tabprevpage'),
|
('{{', 'tabprevpage'),
|
||||||
|
Loading…
Reference in New Issue
Block a user