Exemplo n.º 1
0
 def writeSettingsNew(self, updateDialog):
     self.log("writeSettingsNew")
     updateDialog.update(90, "Repairing Channel Configurations", "Saving Changes")
     if FileAccess.exists(Globals.SETTINGS_FLE_REPAIR):
         FileAccess.delete(Globals.SETTINGS_FLE_REPAIR)
         
     try:
         fle = FileAccess.open(Globals.SETTINGS_FLE_REPAIR, "w")
     except Exception,e:
         self.log("Unable to open the file for writing")
         return
Exemplo n.º 2
0
            return

        flewrite = Globals.uni("<settings>\n")

        for i in range(len(self.amendedSettings)):
            updateDialog.update(int(i * .07) + 1, "Repairing Channel Configurations", "Saving Channel " + str(i+1))
            try:
                flewrite += Globals.uni('    <setting id="') + Globals.uni(self.amendedSettings[i][0]) + Globals.uni('" value="') + Globals.uni(self.amendedSettings[i][1]) + Globals.uni('" />\n')
            except:
                pass
        flewrite += Globals.uni('</settings>\n')
        fle.write(flewrite)
        fle.close()
        
        if FileAccess.exists(Globals.SETTINGS_FLE_REPAIR):
            FileAccess.delete(self.logfile)
            FileAccess.rename(Globals.SETTINGS_FLE_REPAIR, self.logfile)
        

    def repairSettings(self):
        self.log("repairSettings")
        rules = True
        MSG = "Channel Repair Failed!"
        MSG1 = ""

        xbmcgui.Dialog().ok("PseudoTV Live - Channel Repair", "[COLOR=red]Warning!![/COLOR] The repair process can alter your channel configurations. Its recommended you backup before continuing.")
        if xbmcgui.Dialog().yesno("PseudoTV Live - Channel Repair", "Start repair process?"):
            # if xbmcgui.Dialog().yesno("PseudoTV Live - Channel Repair", "Remove Channel rules?"):
                # rules = False

            self.log("repairSettings, Keep rules = " + str(rules))