don't reference timestruct items by index
authorMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Sat, 1 Dec 2007 17:53:04 +0000 (17:53 +0000)
committerMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Sat, 1 Dec 2007 17:53:04 +0000 (17:53 +0000)
autotimer/src/AutoTimer.py
autotimer/src/AutoTimerComponent.py

index 5a7dee5..ad75673 100644 (file)
@@ -449,7 +449,7 @@ class AutoTimer:
                                timer.update(begin, timestamp)
 
                                # Check Duration, Timespan and Excludes
-                               if timer.checkServices(serviceref) or timer.checkDuration(duration) or timer.checkTimespan(timestamp) or timer.checkFilter(name, description, evt.getExtendedDescription(), str(timestamp[6])):
+                               if timer.checkServices(serviceref) or timer.checkDuration(duration) or timer.checkTimespan(timestamp) or timer.checkFilter(name, description, evt.getExtendedDescription(), str(timestamp.tm_wday)):
                                        continue
 
                                # Apply E2 Offset
index 7a21bac..02209c8 100644 (file)
@@ -119,21 +119,21 @@ class AutoTimerComponent(object):
                # Check if we span a day
                if haveDayspan:
                        # Check if begin of event is later than our timespan starts
-                       if time[3] > begin[0] or (time[3] == begin[0] and time[4] >= begin[1]):
+                       if time.tm_hour > begin[0] or (time.tm_hour == begin[0] and time.tm_min >= begin[1]):
                                # If so, event is in our timespan
                                return False
                        # Check if begin of event is earlier than our timespan end
-                       if time[3] < end[0] or (time[3] == end[0] and time[4] <= end[1]):
+                       if time.tm_hour < end[0] or (time.tm_hour == end[0] and time.tm_min <= end[1]):
                                # If so, event is in our timespan
                                return False
                        return True
                else:
                        # Check if event begins earlier than our timespan starts 
-                       if time[3] < begin[0] or (time[3] == begin[0] and time[4] < begin[1]):
+                       if time.tm_hour < begin[0] or (time.tm_hour == begin[0] and time.tm_min < begin[1]):
                                # Its out of our timespan then
                                return True
                        # Check if event begins later than our timespan ends
-                       if time[3] > end[0] or (time[3] == end[0] and time[4] > end[1]):
+                       if time.tm_hour > end[0] or (time.tm_hour == end[0] and time.tm_min > end[1]):
                                # Its out of our timespan then
                                return True
                        return False