X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/dfbd5853de864053e8ac10d1269e8137f3cb5a34..cf630f0cd1366036ae201702b177bfe95de3d03f:/RecordTimer.py?ds=sidebyside
diff --git a/RecordTimer.py b/RecordTimer.py
index 9f78ff24..a5df6725 100644
--- a/RecordTimer.py
+++ b/RecordTimer.py
@@ -10,6 +10,7 @@ import xml.dom.minidom
from Screens.MessageBox import MessageBox
from Screens.SubserviceSelection import SubserviceSelection
import NavigationInstance
+from time import localtime
from Tools.XMLTools import elementsWithTag, mergeText
from ServiceReference import ServiceReference
@@ -238,7 +239,7 @@ class RecordTimer(timer.Timer):
self.record(createTimer(timer))
def strToXML(self, str):
- return str.replace('&', '&').replace('<', '<').replace('>', '>').replace("'", '''). replace('"', '&qout;')
+ return str.replace('&', '&').replace('<', '<').replace('>', '>').replace("'", '''). replace('"', '"')
def saveTimer(self):
#doc = xml.dom.minidom.Document()
@@ -302,13 +303,13 @@ class RecordTimer(timer.Timer):
list.append(' disabled="' + str(int(timer.disabled)) + '"')
list.append('>\n')
- for time, code, msg in timer.log_entries:
- list.append('')
- list.append(str(msg))
- list.append('\n')
+ #for time, code, msg in timer.log_entries:
+ #list.append('')
+ #list.append(str(msg))
+ #list.append('\n')
list.append('\n')
@@ -330,12 +331,20 @@ class RecordTimer(timer.Timer):
time_match = 0
for x in self.timer_list:
if str(x.service_ref) == str(service):
- if x.eit is not None and x.repeated == 0:
- if x.eit == eventid:
- return duration
- elif x.repeated != 0:
- # TODO: implement!
- pass
+ #if x.eit is not None and x.repeated == 0:
+ # if x.eit == eventid:
+ # return duration
+ if x.repeated != 0:
+ chktime = localtime(begin)
+ time = localtime(x.begin)
+ chktimecmp = chktime.tm_wday * 1440 + chktime.tm_hour * 60 + chktime.tm_min
+ for y in range(7):
+ if x.repeated & (2 ** y):
+ timecmp = y * 1440 + time.tm_hour * 60 + time.tm_min
+ if timecmp <= chktimecmp < (timecmp + ((x.end - x.begin) / 60)):
+ time_match = ((timecmp + ((x.end - x.begin) / 60)) - chktimecmp) * 60
+ elif chktimecmp <= timecmp < (chktimecmp + (duration / 60)):
+ time_match = ((chktimecmp + (duration / 60)) - timecmp) * 60
elif x.eit is None:
end = begin + duration
if begin <= x.begin <= end: