def DeleteSettings2(): log('utilities: DeleteSettings2') ClearChanFavorites(False) if FileAccess.exists(SETTINGS_FLE): if yesnoDialog("Delete Current Channel Configurations?"): try: REAL_SETTINGS.setSetting("Config", "") REAL_SETTINGS.setSetting("CurrentChannel", "1") FileAccess.delete(SETTINGS_FLE) infoDialog("Channel Configurations Cleared") except: pass # Return to PTVL Settings REAL_SETTINGS.openSettings()
def DeleteSettings2(): log('utilities: DeleteSettings2') ClearChanFavorites(False) if FileAccess.exists(SETTINGS_FLE): if yesnoDialog("Delete Current Channel Configurations?"): try: REAL_SETTINGS.setSetting("Config","") REAL_SETTINGS.setSetting("CurrentChannel","1") FileAccess.delete(SETTINGS_FLE) infoDialog("Channel Configurations Cleared") except: pass # Return to PTVL Settings REAL_SETTINGS.openSettings()
def downloadSkin(self, selSkin): self.log("downloadSkin") url = self.SkinPanel.getSelectedItem().getProperty('PTVL.SKINZIP') dl = os.path.join(PTVL_SKIN_LOC, '%s.zip' % selSkin) try: print url, dl download(url, dl, '') all(dl, os.path.join(PTVL_SKIN_LOC, ''), True) try: FileAccess.delete(dl) except: pass return True except: return False
def downloadSkin(self, selSkin): self.log("downloadSkin") url = self.SkinPanel.getSelectedItem().getProperty('PTVL.SKINZIP') dl = os.path.join(PTVL_SKIN_LOC,'%s.zip'%selSkin) try: print url, dl download(url, dl, '') all(dl, os.path.join(PTVL_SKIN_LOC,''),True) try: FileAccess.delete(dl) except: pass return True except: return False
def makeXMLTV(self, data, filepath): self.log('makeXMLTV') finished = False if not FileAccess.exists(os.path.dirname(filepath)): FileAccess.mkdir(os.path.dirname(filepath)) if FileAccess.exists(filepath): FileAccess.delete(filepath) fle = open(filepath, "w") try: xml = data.toxml(encoding='UTF-8'); log('writing item: %s' % (filepath)) if FileAccess.exists(filepath): finished = True except Exception as e: xml = '<?xml version="1.0" encoding="UTF-8"?>' xml += '<error>' + str(e) + '</error>'; xmllst = xml.replace('><','>\n<') xmllst = self.cleanChanName(xmllst) fle.write("%s" % xmllst) fle.close() return finished