def saveXML(self): try: fp = file(self.filename, 'w') fp.write("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n") fp.write("<ci>\n") fp.write("\t<slot>\n") fp.write("\t\t<id>%s</id>\n" % self.ci_slot) for item in self.selectedcaid: if len(self.selectedcaid): fp.write("\t\t<caid id=\"%s\" />\n" % item[0]) for item in self.servicelist: if len(self.servicelist): name = item[0].replace('<', '<') name = name.replace('&', '&') name = name.replace('>', '>') name = name.replace('"', '"') name = name.replace("'", ''') if item[2] == 1: fp.write( "\t\t<provider name=\"%s\" dvbnamespace=\"%s\" />\n" % (stringToXML(name), item[3])) else: fp.write("\t\t<service name=\"%s\" ref=\"%s\" />\n" % (stringToXML(name), item[3])) fp.write("\t</slot>\n") fp.write("</ci>\n") fp.close() except: print "[CI_Config_CI%d] xml not written" % self.ci_slot os.unlink(self.filename) cihelper.load_ci_assignment(force=True)
def saveXML(self): try: fp = file(self.filename, 'w') fp.write("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n") fp.write("<ci>\n") fp.write("\t<slot>\n") fp.write("\t\t<id>%s</id>\n" % self.ci_slot) for item in self.selectedcaid: if len(self.selectedcaid): fp.write("\t\t<caid id=\"%s\" />\n" % item[0]) for item in self.servicelist: if len(self.servicelist): name = item[0].replace('<', '<') name = name.replace('&', '&') name = name.replace('>', '>') name = name.replace('"', '"') name = name.replace("'", ''') if item[2]==1: fp.write("\t\t<provider name=\"%s\" dvbnamespace=\"%s\" />\n" % (name, item[3])) else: fp.write("\t\t<service name=\"%s\" ref=\"%s\" />\n" % (name, item[3])) fp.write("\t</slot>\n") fp.write("</ci>\n") fp.close() except: print "[CI_Config_CI%d] xml not written" %self.ci_slot os.unlink(self.filename) cihelper.load_ci_assignment(force = True)
def activate_all(session): cihelper.load_ci_assignment()
def activate_all(session, editcallback=False): cihelper.load_ci_assignment()
def cancel(self): self.saveXML() cihelper.load_ci_assignment(force=True) self.close()