From d9d8211a3bd15d9f374e8a829fbfcbbf77c0638d Mon Sep 17 00:00:00 2001
From: Martin Konecny <martin.konecny@gmail.com>
Date: Wed, 4 Apr 2012 15:25:57 -0400
Subject: [PATCH] CC-3601: Pypo schedule needs to be sorted before pushing

-fixed
---
 python_apps/pypo/pypopush.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/python_apps/pypo/pypopush.py b/python_apps/pypo/pypopush.py
index 24f48c7cb..e40897d68 100644
--- a/python_apps/pypo/pypopush.py
+++ b/python_apps/pypo/pypopush.py
@@ -79,8 +79,9 @@ class PypoPush(Thread):
             tcoming = time.gmtime(timenow + self.push_ahead)
             str_tnow_s = "%04d-%02d-%02d-%02d-%02d-%02d" % (tnow[0], tnow[1], tnow[2], tnow[3], tnow[4], tnow[5])
             str_tcoming_s = "%04d-%02d-%02d-%02d-%02d-%02d" % (tcoming[0], tcoming[1], tcoming[2], tcoming[3], tcoming[4], tcoming[5])
-                        
-            for pkey in schedule:
+            
+            sorted_schedule = sorted(schedule.keys())
+            for pkey in sorted_schedule:
                 plstart = schedule[pkey]['start'][0:19]
          
                 if str_tnow_s <= plstart and plstart < str_tcoming_s: