- try:
- for rtimer in recorddict.get(serviceref, []):
- if rtimer.eit == eit or config.plugins.autotimer.try_guessing.value and getTimeDiff(rtimer, begin, end) > ((duration/10)*8):
- newEntry = rtimer
-
- # Abort if we don't want to modify timers or timer is repeated
- if config.plugins.autotimer.refresh.value == "none" or newEntry.repeated:
- raise AutoTimerIgnoreTimerException("Won't modify existing timer because either no modification allowed or repeated timer")
-
- if hasattr(newEntry, "isAutoTimer"):
- print "[AutoTimer] Modifying existing AutoTimer!"
- else:
- if config.plugins.autotimer.refresh.value != "all":
- raise AutoTimerIgnoreTimerException("Won't modify existing timer because it's no timer set by us")
- print "[AutoTimer] Warning, we're messing with a timer which might not have been set by us"
-
- func = NavigationInstance.instance.RecordTimer.timeChanged
- modified += 1
-
- # Modify values saved in timer
- newEntry.name = name
- newEntry.description = description
- newEntry.begin = int(begin)
- newEntry.end = int(end)
- newEntry.service_ref = ServiceReference(serviceref)
+ for rtimer in recorddict.get(serviceref, ()):
+ if rtimer.eit == eit or config.plugins.autotimer.try_guessing.value and getTimeDiff(rtimer, begin, end) > ((duration/10)*8):
+ oldExists = True