From 4195005f05b87bbd75c6d9dc5ca034cceecaa4b7 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 11 Feb 2008 13:35:50 -0500 Subject: Use /etc/adjtime as the configuration file for UTC/not-UTC. Also, remove ARC support while we're here - it's pointless. --- timezone.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'timezone.py') diff --git a/timezone.py b/timezone.py index c58736ce4..3960d819d 100644 --- a/timezone.py +++ b/timezone.py @@ -51,20 +51,31 @@ class Timezone: f = open(instPath + "/etc/sysconfig/clock", "w") f.write('ZONE="%s"\n' % self.tz) - f.write("UTC=%s\n" % bool(self.utc)) - f.write("ARC=%s\n" % bool(self.arc)) + f.close() + + try: + f = open(instPath + "/etc/adjtime", "r") + lines = f.readlines() + f.close() + except: + lines = [ "0.0 0 0.0\n", "0\n" ] + f = open(instPath + "/etc/adjtime", "w") + f.write(lines[0]) + f.write(lines[1]) + if self.utc: + f.write("UTC\n") + else: + f.write("LOCAL\n") f.close() def getTimezoneInfo(self): - return (self.tz, self.utc, self.arc) + return (self.tz, self.utc) - def setTimezoneInfo(self, timezone, asUtc = 0, asArc = 0): + def setTimezoneInfo(self, timezone, asUtc = 0): self.tz = timezone self.utc = asUtc - self.arc = asArc def __init__(self): self.tz = "America/New_York" self.utc = 0 - self.arc = 0 -- cgit