From a6c74c734fa212ea6c5eea48decf7303a994246d Mon Sep 17 00:00:00 2001 From: Moritz Venn Date: Sat, 1 Dec 2007 17:53:04 +0000 Subject: [PATCH] don't reference timestruct items by index --- autotimer/src/AutoTimer.py | 2 +- autotimer/src/AutoTimerComponent.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/autotimer/src/AutoTimer.py b/autotimer/src/AutoTimer.py index 5a7dee5f..ad75673b 100644 --- a/autotimer/src/AutoTimer.py +++ b/autotimer/src/AutoTimer.py @@ -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 diff --git a/autotimer/src/AutoTimerComponent.py b/autotimer/src/AutoTimerComponent.py index 7a21bac2..02209c8d 100644 --- a/autotimer/src/AutoTimerComponent.py +++ b/autotimer/src/AutoTimerComponent.py @@ -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 -- 2.20.1