- #t = doc.createTextNode("\t")
- #root_element.appendChild(t)
- #t = doc.createElement('timer')
- #t.setAttribute("begin", str(int(timer.begin)))
- #t.setAttribute("end", str(int(timer.end)))
- #t.setAttribute("serviceref", str(timer.service_ref))
- #t.setAttribute("repeated", str(timer.repeated))
- #t.setAttribute("name", timer.name)
- #t.setAttribute("description", timer.description)
- #t.setAttribute("eit", str(timer.eit))
-
- #for time, code, msg in timer.log_entries:
- #t.appendChild(doc.createTextNode("\t\t"))
- #l = doc.createElement('log')
- #l.setAttribute("time", str(time))
- #l.setAttribute("code", str(code))
- #l.appendChild(doc.createTextNode(msg))
- #t.appendChild(l)
- #t.appendChild(doc.createTextNode("\n"))
-
- #root_element.appendChild(t)
- #t = doc.createTextNode("\n")
- #root_element.appendChild(t)
+ #t = xml.etree.cElementTree.SubElement(root_element, 'timers')
+ #t.set("begin", str(int(timer.begin)))
+ #t.set("end", str(int(timer.end)))
+ #t.set("serviceref", str(timer.service_ref))
+ #t.set("repeated", str(timer.repeated))
+ #t.set("name", timer.name)
+ #t.set("description", timer.description)
+ #t.set("afterevent", str({
+ # AFTEREVENT.NONE: "nothing",
+ # AFTEREVENT.STANDBY: "standby",
+ # AFTEREVENT.DEEPSTANDBY: "deepstandby",
+ # AFTEREVENT.AUTO: "auto"}))
+ #if timer.eit is not None:
+ # t.set("eit", str(timer.eit))
+ #if timer.dirname is not None:
+ # t.set("location", str(timer.dirname))
+ #t.set("disabled", str(int(timer.disabled)))
+ #t.set("justplay", str(int(timer.justplay)))
+ #t.text = "\n"
+ #t.tail = "\n"