def check_build_update(): from resources.libs.common import logging from resources.libs.common import tools from resources.libs.gui import window response = tools.open_url(CONFIG.BUILDFILE) if not response: return link = response.text.replace('\n', '').replace('\r', '').replace('\t', '') match = re.compile('name="%s".+?ersion="(.+?)".+?con="(.+?)".+?anart="(.+?)"' % CONFIG.BUILDNAME).findall(link) if len(match) > 0: version = match[0][0] icon = match[0][1] fanart = match[0][2] CONFIG.set_setting('latestversion', version) if version > CONFIG.BUILDVERSION: if CONFIG.DISABLEUPDATE == 'false': logging.log("[Check Updates] [Installed Version: {0}] [Current Version: {1}] Opening Update Window".format(CONFIG.BUILDVERSION, version)) window.show_update_window(CONFIG.BUILDNAME, CONFIG.BUILDVERSION, version, icon, fanart) else: logging.log("[Check Updates] [Installed Version: {0}] [Current Version: {1}] Update Window Disabled".format(CONFIG.BUILDVERSION, version)) else: logging.log("[Check Updates] [Installed Version: {0}] [Current Version: {1}]".format(CONFIG.BUILDVERSION, version)) else: logging.log("[Check Updates] ERROR: Unable to find build version in build text file", level=xbmc.LOGERROR)
def test_update(): from resources.libs import check from resources.libs.gui import window if CONFIG.BUILDNAME == "": window.show_update_window() else: window.show_update_window( CONFIG.BUILDNAME, CONFIG.BUILDVERSION, CONFIG.BUILDLATEST, check.check_build(CONFIG.BUILDNAME, 'icon'), check.check_build(CONFIG.BUILDNAME, 'fanart'))
def check_build_update(): from resources.libs.common import logging from resources.libs.common import tools from resources.libs.gui import window response = tools.open_url(CONFIG.BUILDFILE) if not response: return link = response.text.replace('\n', '').replace('\r', '').replace('\t', '') match = re.compile( 'name="%s".+?ersion="(.+?)".+?con="(.+?)".+?anart="(.+?)"' % CONFIG.BUILDNAME.replace('[', '\[').replace(']', '\]')).findall(link) if len(match) > 0: version = match[0][0] icon = match[0][1] fanart = match[0][2] CONFIG.set_setting('latestversion', version) if version > CONFIG.BUILDVERSION: if CONFIG.DISABLEUPDATE == 'false': logging.log( "[Revisa Actualizaciones] [Versión Instalada: {0}] [Versión Actual: {1}] Abrir Ventana de Actualización" .format(CONFIG.BUILDVERSION, version)) window.show_update_window(CONFIG.BUILDNAME, CONFIG.BUILDVERSION, version, icon, fanart) else: logging.log( "[Revisa Actualizaciones] [Versión Instalada: {0}] [Versión Actual: {1}] Ventana de Actualización Deshabilitada" .format(CONFIG.BUILDVERSION, version)) else: logging.log( "[Revisa Actualizaciones] [Versión Instalada: {0}] [Versión Actual: {1}]" .format(CONFIG.BUILDVERSION, version)) else: logging.log( "[Revisa Actualizaciones] ERROR: No se puede encontrar la versión de la Build en el archivo de texto", level=xbmc.LOGERROR)