X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/349f063f29e1624a633765aba31e3466e057347c..043ef5bb98a2b1605dd3704bb34b813697a66376:/RecordTimer.py diff --git a/RecordTimer.py b/RecordTimer.py index abea96d5..f9382e84 100644 --- a/RecordTimer.py +++ b/RecordTimer.py @@ -182,7 +182,10 @@ def createTimer(xml): serviceref = ServiceReference(str(xml.getAttribute("serviceref"))) description = xml.getAttribute("description").encode("utf-8") repeated = xml.getAttribute("repeated").encode("utf-8") - eit = long(xml.getAttribute("eit").encode("utf-8")) + try: + eit = long(xml.getAttribute("eit").encode("utf-8")) + except: + eit = None name = xml.getAttribute("name").encode("utf-8") #filename = xml.getAttribute("filename").encode("utf-8") entry = RecordTimerEntry(serviceref, begin, end, name, description, eit) @@ -221,7 +224,10 @@ class RecordTimer(timer.Timer): root = doc.childNodes[0] for timer in elementsWithTag(root.childNodes, "timer"): self.record(createTimer(timer)) - + + def strToXML(self, str): + return str.replace('&', '&').replace('<', '<').replace('>', '>').replace("'", '''). replace('"', '&qout;') + def saveTimer(self): #doc = xml.dom.minidom.Document() #root_element = doc.createElement('timers') @@ -274,8 +280,8 @@ class RecordTimer(timer.Timer): list.append(' end="' + str(int(timer.end)) + '"') list.append(' serviceref="' + str(timer.service_ref) + '"') list.append(' repeated="' + str(int(timer.repeated)) + '"') - list.append(' name="' + str(timer.name) + '"') - list.append(' description="' + str(timer.description) + '"') + list.append(' name="' + str(self.strToXML(timer.name)) + '"') + list.append(' description="' + str(self.strToXML(timer.description)) + '"') list.append(' eit="' + str(timer.eit) + '"') list.append('>\n')