Commits

akosch  committed e025c87

Cosmetic fix in parsing

  • Participants
  • Parent commits 1df9bea

Comments (0)

Files changed (2)

     date_boxes = tree.xpath("//p[@class='date_box']")
 
     date_boxes_sorted = []
-
-    date_boxes_sorted.append(date_boxes[0])
-    date_boxes_sorted.append(date_boxes[4])
-    date_boxes_sorted.append(date_boxes[1])
-    date_boxes_sorted.append(date_boxes[5])
-    date_boxes_sorted.append(date_boxes[2])
-    date_boxes_sorted.append(date_boxes[6])
-    date_boxes_sorted.append(date_boxes[3])
-    date_boxes_sorted.append(date_boxes[7])
+    
+    for i in range(0,len(date_boxes)/2):
+        date_boxes_sorted.append(date_boxes[i])
+        date_boxes_sorted.append(date_boxes[i+len(date_boxes)/2])
 
     for date_box in date_boxes_sorted: 
 
 
 
 schedule = getScheduleForChannelID(32)
+
+schedule.prettyPrint()
+
 for x in sorted(schedule.programs, key=lambda y: y.time):
     print x.time,
     print ' ',