def restoreFromZip(): profile = datapath file = [] try: current, dirs, files = os.walk(profile).next() except: pass for file in files: if file.endswith('.zip'): date = file.split('-', 1)[-1].replace('.zip', '') import dxmnew dxmnew.unzipAndMove(os.path.join(profile, file), profile, None) newEPGAvailable(date) return
try: download(link, path, dp) except: deleteFile(path) return False #doesn't seem to want to work! #if generateMD5(path) != md5: # deleteFile(path) # return False zip = path dst = xbmc.translatePath(ADDON.getAddonInfo('profile')) import dxmnew dxmnew.unzipAndMove(zip, dst, None) try: deleteFile(zip) except: pass dixie.SetSetting('updated.channels', channel) xbmcgui.Window(10000).setProperty('OTT_UPDATE', date) if xbmcgui.Window(10000).getProperty('OTT_RUNNING') == 'True': return newEPGAvailable() if not silent: ok(TITLE, '', 'EPG successfully updated.', '')
import urllib,dxmnew,xbmc,xbmcgui,xbmcaddon ADDON = xbmcaddon.Addon(id = 'script.tvguidedixie') dialog = xbmcgui.DialogProgress() dialog.create('Please Wait.', 'Default Logo Pack Downloading...') dialog.update(0) datapath = xbmc.translatePath(ADDON.getAddonInfo('profile')) Path=os.path.join(datapath,'extras') try: os.makedirs(Path) except: pass Url = 'https://raw.github.com/DixieDean/Dixie-Deans-XBMC-Repo/master/logos.zip' LocalName = 'logos.zip' LocalFile = xbmc.translatePath(os.path.join(Path, LocalName)) dialog.update(33) try: urllib.urlretrieve(Url,LocalFile) except:xbmc.executebuiltin("XBMC.Notification(TV Guide Dixie,Logo download failed,3000)") dialog.update(66) if os.path.isfile(LocalFile): extractFolder = Path pluginsrc = xbmc.translatePath(os.path.join(extractFolder)) dxmnew.unzipAndMove(LocalFile,extractFolder,pluginsrc) dialog.update(100) dialog.close() ok = xbmcgui.Dialog() ok.ok('TV Guide Dixie', 'Logo Pack Download Complete') try:os.remove(LocalFile) except:pass
filename = os.path.join(profile, file) deleteFile(filename) oldpath = path path = path.replace('.newzip', '.zip') try: os.rename(oldpath, path) except: pass #doesn't seem to want to work! #if generateMD5(path) != md5: # deleteFile(path) # return False import dxmnew dxmnew.unzipAndMove(path, profile, None) #try: deleteFile(path) #except: pass dixie.SetSetting('updated.channels', channel) #xbmcgui.Window(10000).setProperty('OTT_UPDATE', date) if xbmcgui.Window(10000).getProperty('OTT_RUNNING') == 'True': return newEPGAvailable(date) if not silent: ok(TITLE, '', 'EPG successfully updated.', '')
try: download(link, path, dp) except: deleteFile(path) return False #doesn't seem to want to work! #if generateMD5(path) != md5: # deleteFile(path) # return False zip = path dst = xbmc.translatePath(ADDON.getAddonInfo('profile')) import dxmnew dxmnew.unzipAndMove(zip, dst, None) try: deleteFile(zip) except: pass dixie.SetSetting('updated.channels', channel) xbmcgui.Window(10000).setProperty('TVDIXIE_UPDATE', date) if xbmcgui.Window(10000).getProperty('TVDIXIE_RUNNING') == 'True': return newEPGAvailable()
oldpath = path path = path.replace('.newzip', '.zip') try: os.rename(oldpath, path) except: pass #doesn't seem to want to work! #if generateMD5(path) != md5: # deleteFile(path) # return False dixie.BackupCats() import dxmnew dxmnew.unzipAndMove(path, profile, None) #try: deleteFile(path) #except: pass dixie.SetSetting('updated.channels', channel) #xbmcgui.Window(10000).setProperty('OTT_UPDATE', date) if xbmcgui.Window(10000).getProperty('OTT_RUNNING') == 'True': return newEPGAvailable(date) if not silent: ok(TITLE, '', 'EPG successfully updated.', '')
dialog.create('Please Wait.', 'Default Logo Pack Downloading...') dialog.update(0) datapath = xbmc.translatePath(ADDON.getAddonInfo('profile')) Path = os.path.join(datapath, 'extras') try: os.makedirs(Path) except: pass Url = 'https://raw.github.com/DixieDean/Dixie-Deans-XBMC-Repo/master/logos.zip' LocalName = 'logos.zip' LocalFile = xbmc.translatePath(os.path.join(Path, LocalName)) dialog.update(33) try: urllib.urlretrieve(Url, LocalFile) except: xbmc.executebuiltin( "XBMC.Notification(TV Guide Dixie,Logo download failed,3000)") dialog.update(66) if os.path.isfile(LocalFile): extractFolder = Path pluginsrc = xbmc.translatePath(os.path.join(extractFolder)) dxmnew.unzipAndMove(LocalFile, extractFolder, pluginsrc) dialog.update(100) dialog.close() ok = xbmcgui.Dialog() ok.ok('TV Guide Dixie', 'Logo Pack Download Complete') try: os.remove(LocalFile) except: pass