From 03f8163764f1a27466312ec54f8df0de8d5cb8a0 Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 15 Aug 2011 16:34:22 -0400 Subject: [PATCH] cc-2682: not using pypo time -Remove messages being sent to pypo to change its timezone -fix time conversion bug in pypo-push --- airtime_mvc/application/models/Preference.php | 1 - python_apps/pypo/pypofetch.py | 4 ---- python_apps/pypo/pypopush.py | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index ef222abfb..792abe9de 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -264,7 +264,6 @@ class Application_Model_Preference Application_Model_Preference::SetValue("timezone", $timezone); date_default_timezone_set($timezone); $md = array("timezone" => $timezone); - RabbitMq::SendMessageToPypo("update_timezone", $md); } public static function GetTimezone(){ diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index ca7f21cea..1a927b969 100755 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -102,10 +102,6 @@ class PypoFetch(Thread): if(command == 'update_schedule'): self.schedule_data = m['schedule'] self.process_schedule(self.schedule_data, "scheduler", False) - elif (command == 'update_timezone'): - logger.info("Setting timezone to %s", m['timezone']) - os.environ['TZ'] = m['timezone'] - time.tzset() elif (command == 'update_stream_setting'): logger.info("Updating stream setting: %s", m['setting']) self.regenerateLiquidsoapConf(m['setting']) diff --git a/python_apps/pypo/pypopush.py b/python_apps/pypo/pypopush.py index 6f7e71722..29f29c088 100755 --- a/python_apps/pypo/pypopush.py +++ b/python_apps/pypo/pypopush.py @@ -152,7 +152,7 @@ class PypoPush(Thread): #mktime takes a time_struct and returns a floating point #gmtime Convert a time expressed in seconds since the epoch to a struct_time in UTC #mktime: expresses the time in local time, not UTC. It returns a floating point number, for compatibility with time(). - epoch_start = calendar.timegm(time.gmtime(time.mktime(time.strptime(pkey, '%Y-%m-%d-%H-%M-%S')))) + epoch_start = calendar.timegm(time.strptime(pkey, '%Y-%m-%d-%H-%M-%S')) #Return the time as a floating point number expressed in seconds since the epoch, in UTC. epoch_now = time.time()