summaryrefslogtreecommitdiff
path: root/glib/update-gtranslit.py
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2020-11-17 15:32:10 +0000
committerPhilip Withnall <pwithnall@endlessos.org>2020-11-17 15:50:07 +0000
commitd270b6c3db5f74384c0ea1570cfea5a0ead3e20f (patch)
treee6f927149b0a18228cb421e0d52dbeb10e5adf99 /glib/update-gtranslit.py
parente187d836ade9c368b34a2ad16491d93d35520751 (diff)
downloadglib-d270b6c3db5f74384c0ea1570cfea5a0ead3e20f.tar.gz
py: Various flake8 cleanups
None of these are particularly significant, but they do get the CI output clean. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Diffstat (limited to 'glib/update-gtranslit.py')
-rwxr-xr-xglib/update-gtranslit.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/glib/update-gtranslit.py b/glib/update-gtranslit.py
index 464fb7655..f2b4f9a3e 100755
--- a/glib/update-gtranslit.py
+++ b/glib/update-gtranslit.py
@@ -4,10 +4,13 @@
#
# ./update-gtranslit.py /path/to/glibc/localedata/locales > gtranslit-data.h
-import sys, os
+import os
+import sys
+
localedir = sys.argv[1]
+
# returns true if the name looks like a POSIX locale name
def looks_like_locale(name):
name, _, variant = name.partition("@")
@@ -34,7 +37,7 @@ def unescape(string):
chunks.append(string[i:])
break
- assert string[start_escape : start_escape + 2] == "<U"
+ assert string[start_escape : (start_escape + 2)] == "<U"
start_escape += 2
end_escape = string.find(">", start_escape)
@@ -65,7 +68,8 @@ class Mapping:
# Scans a string like
#
- # <U00C4> "<U0041><U0308>";"<U0041><U0045>" % LATIN CAPITAL LETTER A WITH DIAERESIS.
+ # <U00C4> "<U0041><U0308>";"<U0041><U0045>" % \
+ # LATIN CAPITAL LETTER A WITH DIAERESIS.
#
# and adds the first all-ascii choice (or IGNORE) to the mapping
# dictionary, with the origin string as the key. In the case of
@@ -227,7 +231,7 @@ chains = {}
def get_chain(name):
- if not name in chains:
+ if name not in chains:
chains[name] = Chain(name)
return chains[name]
@@ -362,8 +366,6 @@ class Serialiser:
mappings_table.append((src_range, ascii_range))
- mapping_end = len(mappings_table)
-
for chain in self.chains:
chain_starts.append(len(chains_table))