From de568c1b24291424f271e1827d1a67446d9e4c70 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 23 Nov 2008 02:02:24 +0100 Subject: [PATCH] Any character can be dead in KLC KeyMapping._cleanup() didn't take this into account. We fix it by stripping the optional final @ from the passed charstr, and strictly checking hex vs single char in the cleaned up string. --- klc2xkb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/klc2xkb b/klc2xkb index 02343e3..d6f49a0 100755 --- a/klc2xkb +++ b/klc2xkb @@ -55,11 +55,12 @@ class KeyMapping(object): def _cleanup(cls, charstr): if charstr == '-1': return None - match = re.match('[0-9A-Fa-f]{4}', charstr) + noat, at, junk = charstr.partition('@') + match = re.match('^[0-9A-Fa-f]{4}$', noat) if match: return unichr(int(match.group(), 16)) - assert len(charstr) == 1 - return charstr + assert len(noat) == 1 + return noat @classmethod def scancode_to_xkbname(cls, scancode): -- 2.32.0.93.g670b81a890