]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Tools/i18n/makelocalealias.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Tools / i18n / makelocalealias.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Tools/i18n/makelocalealias.py b/AppPkg/Applications/Python/Python-2.7.2/Tools/i18n/makelocalealias.py
deleted file mode 100644 (file)
index 7585a10..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/env python\r
-"""\r
-    Convert the X11 locale.alias file into a mapping dictionary suitable\r
-    for locale.py.\r
-\r
-    Written by Marc-Andre Lemburg <mal@genix.com>, 2004-12-10.\r
-\r
-"""\r
-import locale\r
-\r
-# Location of the alias file\r
-LOCALE_ALIAS = '/usr/share/X11/locale/locale.alias'\r
-\r
-def parse(filename):\r
-\r
-    f = open(filename)\r
-    lines = f.read().splitlines()\r
-    data = {}\r
-    for line in lines:\r
-        line = line.strip()\r
-        if not line:\r
-            continue\r
-        if line[:1] == '#':\r
-            continue\r
-        locale, alias = line.split()\r
-        # Strip ':'\r
-        if locale[-1] == ':':\r
-            locale = locale[:-1]\r
-        # Lower-case locale\r
-        locale = locale.lower()\r
-        # Ignore one letter locale mappings (except for 'c')\r
-        if len(locale) == 1 and locale != 'c':\r
-            continue\r
-        # Normalize encoding, if given\r
-        if '.' in locale:\r
-            lang, encoding = locale.split('.')[:2]\r
-            encoding = encoding.replace('-', '')\r
-            encoding = encoding.replace('_', '')\r
-            locale = lang + '.' + encoding\r
-            if encoding.lower() == 'utf8':\r
-                # Ignore UTF-8 mappings - this encoding should be\r
-                # available for all locales\r
-                continue\r
-        data[locale] = alias\r
-    return data\r
-\r
-def pprint(data):\r
-\r
-    items = data.items()\r
-    items.sort()\r
-    for k,v in items:\r
-        print '    %-40s%r,' % ('%r:' % k, v)\r
-\r
-def print_differences(data, olddata):\r
-\r
-    items = olddata.items()\r
-    items.sort()\r
-    for k, v in items:\r
-        if not data.has_key(k):\r
-            print '#    removed %r' % k\r
-        elif olddata[k] != data[k]:\r
-            print '#    updated %r -> %r to %r' % \\r
-                  (k, olddata[k], data[k])\r
-        # Additions are not mentioned\r
-\r
-if __name__ == '__main__':\r
-    data = locale.locale_alias.copy()\r
-    data.update(parse(LOCALE_ALIAS))\r
-    print_differences(data, locale.locale_alias)\r
-    print\r
-    print 'locale_alias = {'\r
-    pprint(data)\r
-    print '}'\r