added utils function for sorting Departures
authorFlorian Schweikert <kelvan@logic.at>
Wed, 7 Dec 2011 21:03:30 +0000 (22:03 +0100)
committerFlorian Schweikert <kelvan@logic.at>
Wed, 7 Dec 2011 21:03:30 +0000 (22:03 +0100)
gotovienna/utils.py

index c498288..2a15f6f 100644 (file)
@@ -9,3 +9,8 @@ def ingreen(x):
 def inblue(x):
     return '\033[94m' + x + '\033[0m'
 
+def sort_departures(dep):
+    print 'sorting ...'
+    d = sorted(dep, lambda x, y: cmp(x['atime'], y['atime']))
+    print map(lambda x: x['atime'], d)
+    return d