From 1e9e2112f73fc3f2e6552158e57d6a623749eb75 Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 4 Mar 2013 00:23:58 +0100 Subject: Fix #2126 (per-server configuration sections) (also move replace_key_with_bound() to core.py, to prevent having common.py depending of config.py) --- src/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/core.py') 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 + -- cgit v1.2.3