+ doc = xml.dom.minidom.Document()
+ root_element = doc.createElement('timers')
+ doc.appendChild(root_element)
+ root_element.appendChild(doc.createTextNode("\n"))
+
+ for timer in self.timer_list + self.processed_timers:
+ # some timers (instant records) don't want to be saved.
+ # skip them
+ if timer.dontSave:
+ continue
+ t = doc.createTextNode("\t")
+ root_element.appendChild(t)
+ t = doc.createElement('timer')
+ t.setAttribute("begin", str(timer.begin))
+ t.setAttribute("end", str(timer.end))
+ t.setAttribute("serviceref", str(timer.service_ref))
+ t.setAttribute("repeated", str(timer.repeated))
+ #t.setAttribute("epgdata", timer.)
+ t.setAttribute("description", "no description") # timer.description)
+ root_element.appendChild(t)
+ t = doc.createTextNode("\n")
+ root_element.appendChild(t)
+
+ file = open(self.Filename, "w")
+ doc.writexml(codecs.getwriter('UTF-8')(file))
+ file.write("\n")
+ file.close()