aboutsummaryrefslogtreecommitdiff
path: root/checklines.py3
diff options
context:
space:
mode:
authorMark Shoulson <mark@kli.org>2017-03-29 10:38:01 -0400
committerMark Shoulson <mark@kli.org>2017-03-29 10:50:53 -0400
commitfcd33da6ed86884ba2b1e6103b848759d4d31eb6 (patch)
treec7931ecaef9fc096b2110e49b1753375cc667482 /checklines.py3
parentMerge branch 'master' of github.com:kragen/xcompose (diff)
downloaddotXCompose-fcd33da6ed86884ba2b1e6103b848759d4d31eb6.tar.gz
dotXCompose-fcd33da6ed86884ba2b1e6103b848759d4d31eb6.tar.bz2
dotXCompose-fcd33da6ed86884ba2b1e6103b848759d4d31eb6.zip
Comments fixed for compatibility with composefuse.
If the inline comment doesn't match the character name, composefuse will overwrite it unless it's got a double-#. Added check in checklines.py3 to detect such. Fixed erroneous names, even some wrong character numbers, per checklines.py3 checks. This will likely become obsolete soon, for 95% of the cases, since I'll make composefuse handle cases where the character name is *followed by* other stuff correctly, so those will go back to #s. It's an open question what the point of doing this was.
Diffstat (limited to 'checklines.py3')
-rwxr-xr-xchecklines.py35
1 files changed, 5 insertions, 0 deletions
diff --git a/checklines.py3 b/checklines.py3
index e38bba1..33258b1 100755
--- a/checklines.py3
+++ b/checklines.py3
@@ -28,5 +28,10 @@ for line in sys.stdin:
print("\tLine's number: {0:X}".format(x))
print("\tChar gives number: {0:X}".format(ord(char)))
print("\tNumber gives character: {0} ({1})".format(c, name(c)))
+ elif comments[1]!='#' and comments[1:].strip() != name(char):
+ # Only report name issues if other stuff is okay.
+ print(line)
+ print("\tLine's char, name: {0} ({1})".format(char, comments[1:].strip()))
+ print("\tCorrect name: "+name(char))
except Exception as e:
print("{0}\n\t{1}".format(line, e))