summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-03-04 00:23:58 +0100
committermathieui <mathieui@mathieui.net>2013-03-04 00:23:58 +0100
commit1e9e2112f73fc3f2e6552158e57d6a623749eb75 (patch)
treea1ce204099f06fcf69a9a66710e9e0eb3890763e /src/core.py
parent4be111b63ebf8ba0be6b12b3e370deaf5a45180f (diff)
downloadpoezio-1e9e2112f73fc3f2e6552158e57d6a623749eb75.tar.gz
poezio-1e9e2112f73fc3f2e6552158e57d6a623749eb75.tar.bz2
poezio-1e9e2112f73fc3f2e6552158e57d6a623749eb75.tar.xz
poezio-1e9e2112f73fc3f2e6552158e57d6a623749eb75.zip
Fix #2126 (per-server configuration sections)
(also move replace_key_with_bound() to core.py, to prevent having common.py depending of config.py)
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core.py b/src/core.py
index b8aaf18e..03f892b6 100644
--- a/src/core.py
+++ b/src/core.py
@@ -381,7 +381,7 @@ class Core(object):
res.append(current)
return res
while self.running:
- big_char_list = [common.replace_key_with_bound(key)\
+ big_char_list = [replace_key_with_bound(key)\
for key in self.read_keyboard()]
# whether to refresh after ALL keys have been handled
for char_list in separate_chars_from_bindings(big_char_list):
@@ -3175,4 +3175,10 @@ class KeyDict(dict):
return lambda: dict.get(self, '_exc_')(k[5:])
return dict.get(self, k, d)
+def replace_key_with_bound(key):
+ bind = config.get(key, key, 'bindings')
+ if not bind:
+ bind = key
+ return bind
+