diff options
author | Erik Troan <ewt@redhat.com> | 2001-06-20 02:00:44 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 2001-06-20 02:00:44 +0000 |
commit | 1a0247090d0d3629a9cd150d63597f94c4f27fad (patch) | |
tree | 1508f8237c8e7fb62f187706bfc5173df8819236 /textw/timezone_text.py | |
parent | dbb4861e176cadfb14c48313fd9922d3dbfcefed (diff) | |
download | anaconda-1a0247090d0d3629a9cd150d63597f94c4f27fad.tar.gz anaconda-1a0247090d0d3629a9cd150d63597f94c4f27fad.tar.xz anaconda-1a0247090d0d3629a9cd150d63597f94c4f27fad.zip |
merge from (now defunct) anaconda-dispatch branch
Diffstat (limited to 'textw/timezone_text.py')
-rw-r--r-- | textw/timezone_text.py | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/textw/timezone_text.py b/textw/timezone_text.py index f96cbcacb..5202f6307 100644 --- a/textw/timezone_text.py +++ b/textw/timezone_text.py @@ -8,18 +8,14 @@ from translate import _ class TimezoneWindow: - def getTimezoneList(self, test): - if not os.access("/usr/lib/timezones.gz", os.R_OK): - if test: - cmd = "./gettzlist" - stdin = None - else: - zoneList = iutil.findtz('/usr/share/zoneinfo', '') - cmd = "" - stdin = None - else: + def getTimezoneList(self): + if os.access("/usr/lib/timezones.gz", os.R_OK): cmd = "/usr/bin/gunzip" stdin = os.open("/usr/lib/timezones.gz", 0) + else: + zoneList = iutil.findtz('/usr/share/zoneinfo', '') + cmd = "" + stdin = None if cmd != "": zones = iutil.execWithCapture(cmd, [ cmd ], stdin = stdin) @@ -48,25 +44,25 @@ class TimezoneWindow: # disable for now return - if os.access("/usr/share/zoneinfo/" + self.l.current(), os.R_OK): - os.environ['TZ'] = self.l.current() - self.label.setText(self.currentTime()) - else: - self.label.setText("") +# if os.access("/usr/share/zoneinfo/" + self.l.current(), os.R_OK): +# os.environ['TZ'] = self.l.current() +# self.label.setText(self.currentTime()) +# else: +# self.label.setText("") def currentTime(self): return "Current time: " + strftime("%X %Z", localtime(time())) - def __call__(self, screen, todo, test): - timezones = self.getTimezoneList(test) - rc = todo.getTimezoneInfo() + def __call__(self, screen, instLang, timezone): + timezones = self.getTimezoneList() + rc = timezone.getTimezoneInfo() if rc: (default, asUtc, asArc) = rc else: - default = todo.instTimeLanguage.getDefaultTimeZone() + default = todo.instLang.getDefaultTimeZone() asUtc = 0 - bb = ButtonBar(screen, [(_("OK"), "ok"), (_("Back"), "back")]) + bb = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON]) t = TextboxReflowed(30, _("What time zone are you located in?")) @@ -111,14 +107,14 @@ class TimezoneWindow: result = self.g.run() rc = bb.buttonPressed (result) - if rc == "back": + if rc == TEXT_BACK_CHECK: screen.popWindow() return INSTALL_BACK else: break screen.popWindow() - todo.setTimezoneInfo(self.l.current(), asUtc = self.c.selected()) + timezone.setTimezoneInfo(self.l.current(), asUtc = self.c.selected()) return INSTALL_OK |