aboutsummaryrefslogtreecommitdiff
path: root/checklines.py3
diff options
context:
space:
mode:
authorGianni Ceccarelli <gianni.ceccarelli@broadbean.com>2021-04-21 14:06:38 +0100
committerGianni Ceccarelli <gianni.ceccarelli@broadbean.com>2021-04-21 14:06:38 +0100
commite4290719f5e0db60fb0f70d1872dd37c973dbed8 (patch)
tree2d55ad46548f79cb72bb7d3f389639930134ce6f /checklines.py3
parentMerge remote-tracking branch 'upstream/master' (diff)
parentMerge branch 'emacsmode' (diff)
downloaddotXCompose-e4290719f5e0db60fb0f70d1872dd37c973dbed8.tar.gz
dotXCompose-e4290719f5e0db60fb0f70d1872dd37c973dbed8.tar.bz2
dotXCompose-e4290719f5e0db60fb0f70d1872dd37c973dbed8.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'checklines.py3')
-rwxr-xr-xchecklines.py38
1 files changed, 7 insertions, 1 deletions
diff --git a/checklines.py3 b/checklines.py3
index e38bba1..4551f0d 100755
--- a/checklines.py3
+++ b/checklines.py3
@@ -6,18 +6,22 @@ from unicodedata import name
import re
import sys
+linecount = 0
for line in sys.stdin:
line=line.strip()
if not line or line[0]=="#":
continue
+ linecount += 1
match=re.match(r'\s*(.*):\s*"(.*?)"\s*(\S*)\s*(#.*)?', line)
if not match:
print("({0})".format(line))
continue
(keystrokes, char, num, comments)=match.groups()
nummatch=re.match(r'^U([0-9A-Fa-f]+)$', num)
+ # There's no number for multichar strings
if not nummatch:
- print("Number not parsed: {0}".format(line))
+ if len(char) == 1:
+ print("Number not parsed: {0}".format(line))
continue
x=int(nummatch.group(1),0x10)
c=chr(x)
@@ -30,3 +34,5 @@ for line in sys.stdin:
print("\tNumber gives character: {0} ({1})".format(c, name(c)))
except Exception as e:
print("{0}\n\t{1}".format(line, e))
+
+print("Done. Checked %d lines."%linecount)