From 2dfbb942eef6c7c92ac95da671bb6fac7ad26a27 Mon Sep 17 00:00:00 2001 From: Ales Kozumplik Date: Mon, 5 Sep 2011 14:18:06 +0200 Subject: isolate localeInfo and expandLangs() from langauges.py into a separate module. After 0c662ebeaf4043ff2e2a1f7d09b527f4bf243047, we can not build due to imports problem during build time (importing pyanaconda.constants tries to import pyanaconda.__init__ which tries to import isys etc.). This change separates the language.py bits and the bits needed during build time. Includes new unit tests. --- scripts/getlangnames.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/getlangnames.py b/scripts/getlangnames.py index bc3cced98..2e579a41a 100644 --- a/scripts/getlangnames.py +++ b/scripts/getlangnames.py @@ -19,26 +19,26 @@ import sys sys.path.append("..") -import language as language +import localeinfo import gettext -langs = language.Language() +localeInfo = localeinfo.get("en_US.UTF-8") names = {} -for k in langs.localeInfo.keys(): +for k in localeInfo.keys(): found = False - for l in language.expandLangs(k): + for l in localeinfo.expandLangs(k): try: f = open("../po/%s.gmo" %(l,)) except (OSError, IOError): continue cat = gettext.GNUTranslations(f) cat.set_output_charset("utf-8") - names[langs.localeInfo[k][0]] = cat.lgettext(langs.localeInfo[k][0]) + names[localeInfo[k][0]] = cat.lgettext(localeInfo[k][0]) found = True break if not found: - names[langs.localeInfo[k][0]] = langs.localeInfo[k][0] + names[localeInfo[k][0]] = localeInfo[k][0] nameList = names.keys() nameList.sort() -- cgit