def main(addonID, param=None): try: import application app = application.Application(addonID) app.run(param) del app except Exception, e: utils.Log('******************* ERROR IN MAIN *******************') utils.Log(str(e)) raise
def getResponse(): request = requests.get(URL, verify=False) response = request.content utils.Log('Response in checkUpdate %s' % str(response)) return json.loads(u"" + (response))
def doOTTUpdate(url, path, zipfile, ottupdate): import download import extract utils.DialogOK( 'A GVAX "Live Update" está disponible.', 'Actualización %s será descargado e instalado en su sistema.' % (ottupdate), 'Gracias.') download.download(url, zipfile) extract.all(zipfile, path, dp='Installing python update') sfile.remove(zipfile) utils.Log('OTT Update %s installed' % str(ottupdate)) xbmc.executebuiltin('UpdateLocalAddons')
def doDSFSkinUpdate(url, path, zipfile, kodiskin): import download import extract utils.DialogOK( 'Un GVAX es "Live Update" disponible.', 'Actualización %s será descargado e instalado en su sistema.' % (kodiskin), 'Gracias.') download.download(url, zipfile) extract.all(zipfile, path, dp='Installing skin update') sfile.remove(zipfile) utils.Log('Skin Update %s installed' % str(kodiskin)) xbmc.executebuiltin('UpdateLocalAddons')
def _onSettingsChanged(self, init=False): relaunch = False for key in self.settings: value = utils.getSetting(key) if value <> self.settings[key]: relaunch = True self.settings[key] = value if init: return if relaunch: utils.Log('Settings changed - relaunching') self.relaunch()
def onFocus(self, controlId): utils.Log('onFocus %d' % controlId) if controlId == SETTINGS: return xbmcgui.Window(10000).setProperty( 'GVAX_DESC', 'Edit your GVAx settings') if controlId == VPN: return xbmcgui.Window(10000).setProperty( 'GVAX_DESC', 'Use the VPN to connect to different countries') if controlId == TVGUIDE: return xbmcgui.Window(10000).setProperty( 'GVAX_DESC', 'Open the TV Guide to show what is on TV') if controlId == MOVIES: return xbmcgui.Window(10000).setProperty( 'GVAX_DESC', 'Open your Movie Library') if controlId == TVSHOWS: return xbmcgui.Window(10000).setProperty( 'GVAX_DESC', 'Open your TV Show Library') if controlId == NETFLIX: return xbmcgui.Window(10000).setProperty( 'GVAX_DESC', 'Watch content from Netflix') if controlId == MOVIEANDTV: return xbmcgui.Window(10000).setProperty( 'GVAX_DESC', 'Browse and search for TV Shows and Movies') if controlId == WORLDTV: return xbmcgui.Window(10000).setProperty( 'GVAX_DESC', 'Browse and search for TV Shows and Movies') if controlId == ANDROID: return xbmcgui.Window(10000).setProperty('GVAX_DESC', 'Open your Android Apps') if controlId == ADULT: return xbmcgui.Window(10000).setProperty('GVAX_DESC', 'Adult Section') xbmcgui.Window(10000).setProperty('GVAX_DESC', '')
def onClick(self, controlId): utils.Log('onClick %d' % controlId)
def onAction(self, action): #see here https://github.com/xbmc/xbmc/blob/master/xbmc/guilib/Key.h for the full list actionId = action.getId() buttonId = action.getButtonCode() if actionId != 107: utils.Log('onAction actionID %d' % actionId) utils.Log('onAction buttonID %d' % buttonId) if actionId in [ACTION_CONTEXT, ACTION_RCLICK]: return self.onContextMenu() if actionId in [ACTION_PARENT_DIR, ACTION_BACK] or buttonId in [ESC]: return self.onBack() try: id = self.getFocus().getId() except: id = 0 select = (actionId == ACTION_SELECT) or (actionId == ACTION_LCLICK) if select and id == MAINLIST: liz = self.getSelectedItem() param = liz.getProperty('Param') image = liz.getProperty('Image') mode = int(liz.getProperty('Mode')) isFolder = liz.getProperty('IsFolder') == 'true' isPlayable = liz.getProperty('IsPlayable') == 'true' if mode == LISTBACK: return self.onBack() if param: self.stopTimer() self.onParams(param, isFolder) self.resetTimer() if select and id == CATEGORIES: categoriesList = categories.getSetting('categories').split('|') if categoriesList[0] == '': categoriesList = [] functionality.ShowCategories(categoriesList) if select and id == SETTINGS: if utils.getSetting('SKIN') == 'GVAx': addonID = 'plugin.video.gvax.tv' else: addonID = 'script.tvguidedixie' functionality.ShowSettings(addonID) if select and id == TOOLS: functionality.OpenTools() if select and id == TOOLS: functionality.OpenTools() if select and id == TVGUIDE: xbmc.executebuiltin('RunScript(script.tvguidedixie)') if select and id == MOVIES: if utils.getSetting('KodiLib') == 'true': xbmc.executebuiltin( 'ActivateWindow(10501,plugin://plugin.video.genesis/?action=movieNavigator,return)' ) else: xbmc.executebuiltin( 'ActivateWindow(10025,videodb://1/2,return)') if select and id == TVSHOWS: if utils.getSetting('KodiLib') == 'true': xbmc.executebuiltin( 'ActivateWindow(10501,plugin://plugin.video.genesis/?action=tvNavigator,return)' ) else: xbmc.executebuiltin( 'ActivateWindow(10025,videodb://2/2,return)') if select and id == NETFLIX: xbmc.executebuiltin( 'StartAndroidActivity("com.netflix.mediaclient"),return') if select and id == MOVIEANDTV: xbmc.executebuiltin('XBMC.RunAddon(plugin.video.genesis)') if select and id == WORLDTV: xbmc.executebuiltin('XBMC.RunAddon(plugin.video.alluc.api)') if select and id == ANDROID: xbmc.executebuiltin( 'ActivateWindow(10025,androidapp://sources/apps,return)') if select and id == ADULT: xbmc.executebuiltin( 'ActivateWindow(10501,plugin://plugin.program.super.favourites/?label=Adult&mode=400&path=special://userdata/addon_data/plugin.program.super.favourites/Super Favourites/Adult/,return)' ) if select and id == VPN: xbmc.executebuiltin( 'RunScript(special://home/addons/plugin.program.vpnicity/manual.py,return)' ) if select and id == VIDEOWINDOW: xbmc.executebuiltin('Action(fullscreen)')
LABEL_NUMERIC = sfAddon.getSetting('LABEL_NUMERIC') == 'true' except: SF_INSTALLED = False LABEL_NUMERIC = False IMAGES = os.path.join(HOME, 'resources', 'images') AUTOSTREAM = utils.getSetting('AUTOSTREAM') == 'true' KIOSKMODE = utils.getSetting('KIOSKMODE') == 'true' KODILIB = utils.getSetting('UseKodiLib') MOVIES = utils.getSetting('MOVIE') TV = utils.getSetting('TV') utils.Log('LIBRARY SETTING:\t%s' % KODILIB) utils.Log('MOVIE SETTING:\t%s' % MOVIES) utils.Log('TV SETTING:\t%s' % TV) GETTEXT = utils.GETTEXT global APPLICATION _SCRIPT = 100 _ADDON = 200 _SETTINGS = 300 _YOUTUBE = 400 _CATCHUP = 500 _TV = 600 _TVLIB = 601 _TVADDON = 602