From 58dc5385100ef890a8e4b7eb79ed2536ae0e9f17 Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 2 Aug 2017 10:16:56 +0000 Subject: [PATCH] Load mappings at module initialisation --- cldr2json.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cldr2json.py b/cldr2json.py index a9633d77f..1a2574698 100755 --- a/cldr2json.py +++ b/cldr2json.py @@ -181,13 +181,14 @@ def load_xkb_mappings(): return name_to_xkb +locale.setlocale(locale.LC_ALL, "C") +name_to_xkb = load_xkb_mappings() + + if __name__ == "__main__": if "DEBUG" in os.environ: logging.basicConfig(level=logging.DEBUG) - locale.setlocale(locale.LC_ALL, "C") - name_to_xkb = load_xkb_mappings() - if len(sys.argv) < 2: print("supply a CLDR keyboard file") sys.exit(1)