From 6f122a2794396f1777e3fe41bc98fda27e67ae44 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 17 Apr 2000 20:00:33 +0000 Subject: merge from anaconda-6-2j-branch --- iutil.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'iutil.py') diff --git a/iutil.py b/iutil.py index 7c7335ada..b64edbc59 100644 --- a/iutil.py +++ b/iutil.py @@ -291,3 +291,42 @@ esac execWithRedirect('/bin/sh', args, stdin = None, stdout = None, stderr = None, root = root) + +def defaultZone(): + if os.access("lang-table", os.R_OK): + f = open("lang-table", "r") + elif os.access("/etc/lang-table", os.R_OK): + f = open("/etc/lang-table", "r") + else: + f = open("/usr/lib/anaconda/lang-table", "r") + + lines = f.readlines () + f.close() + + for line in lines: + string.strip(line) + l = string.split(line) + if l[4] == os.environ["LANG"]: + return l[6] + + return "America/New_York" + +def defaultKeyboard(): + if os.access("lang-table", os.R_OK): + f = open("lang-table", "r") + elif os.access("/etc/lang-table", os.R_OK): + f = open("/etc/lang-table", "r") + else: + f = open("/usr/lib/anaconda/lang-table", "r") + + lines = f.readlines () + f.close() + + for line in lines: + string.strip(line) + l = string.split(line) + if l[4] == os.environ["LANG"]: + return l[5] + + return "us" + -- cgit