예제 #1
0
def reload_fix(default=None):
    from resources.libs import db
    from resources.libs.common import logging
    from resources.libs import skin
    from resources.libs import update

    dialog = xbmcgui.Dialog()

    dialog.ok(
        CONFIG.ADDONTITLE,
        "[COLOR red]ADVERTENCIA:[/COLOR] [COLOR {0}] A veces, Recargando el Perfil hace que Kodi se bloquee. Mientras Kodi está Recargando el Perfil, Por Favor No Presione Ningún Botón![/COLOR]"
        .format(CONFIG.COLOR2))

    if not os.path.exists(CONFIG.PACKAGES):
        os.makedirs(CONFIG.PACKAGES)
    if default is None:
        skin.look_and_feel_data('save')
    redo_thumbs()
    xbmc.executebuiltin('ActivateWindow(Home)')
    reload_profile()
    xbmc.sleep(10000)
    if CONFIG.KODIV >= 17:
        db.kodi_17_fix()
    if default is None:
        logging.log("Switching to: {0}".format(
            CONFIG.get_setting('defaultskin')))
        gotoskin = CONFIG.get_setting('defaultskin')
        skin.switch_to_skin(gotoskin)
        skin.look_and_feel_data('restore')
    update.addon_updates('reset')
    update.force_update()
    xbmc.executebuiltin("ReloadSkin()")
예제 #2
0
def reload_fix(default=None):
    from resources.libs import db
    from resources.libs.common import logging
    from resources.libs import skin
    from resources.libs import update

    dialog = xbmcgui.Dialog()
    
    dialog.ok(CONFIG.ADDONTITLE,
                  "[COLOR {0}]WARNING: Sometimes Reloading the Profile causes Kodi to crash. While Kodi is Reloading the Profile Please Do Not Press Any Buttons![/COLOR]".format(CONFIG.COLOR2))
                  
    if not os.path.exists(CONFIG.PACKAGES):
        os.makedirs(CONFIG.PACKAGES)
    if default is None:
        skin.look_and_feel_data('save')
    redo_thumbs()
    xbmc.executebuiltin('ActivateWindow(Home)')
    reload_profile()
    xbmc.sleep(10000)
    if CONFIG.KODIV >= 17:
        db.kodi_17_fix()
    if default is None:
        logging.log("Switching to: {0}".format(CONFIG.get_setting('defaultskin')))
        gotoskin = CONFIG.get_setting('defaultskin')
        skin.switch_to_skin(gotoskin)
        skin.look_and_feel_data('restore')
    update.addon_updates('reset')
    update.force_update()
    xbmc.executebuiltin("ReloadSkin()")
예제 #3
0
def reload_fix(default=None):
    from resources.libs import db
    from resources.libs.common import logging
    from resources.libs import skin
    from resources.libs import update

    dialog = xbmcgui.Dialog()

    dialog.ok(
        CONFIG.ADDONTITLE,
        "[COLOR {0}]AVISO: Às vezes, recarregar o perfil causa o travamento do Kodi. Enquanto Kodi estiver recarregando o perfil, não pressione nenhum botão![/COLOR]"
        .format(CONFIG.COLOR2))

    if not os.path.exists(CONFIG.PACKAGES):
        os.makedirs(CONFIG.PACKAGES)
    if default is None:
        skin.look_and_feel_data('save')
    redo_thumbs()
    xbmc.executebuiltin('ActivateWindow(Home)')
    reload_profile()
    xbmc.sleep(10000)
    if CONFIG.KODIV >= 17:
        db.kodi_17_fix()
    if default is None:
        logging.log("Switching to: {0}".format(
            CONFIG.get_setting('defaultskin')))
        gotoskin = CONFIG.get_setting('defaultskin')
        skin.switch_to_skin(gotoskin)
        skin.look_and_feel_data('restore')
    update.addon_updates('reset')
    update.force_update()
    xbmc.executebuiltin("ReloadSkin()")
예제 #4
0
def install_addon_from_url(name, url):
    from resources.libs.downloader import Downloader
    from resources.libs import db
    from resources.libs import extract
    from resources.libs.common import logging
    from resources.libs import skin
    from resources.libs.common import tools

    progress_dialog = xbmcgui.DialogProgress()

    response = tools.open_url(url, check=True)

    if not response:
        logging.log_notify(
            "[COLOR {0}]Addon Installer[/COLOR]".format(CONFIG.COLOR1),
            '[COLOR {0}]{1}:[/COLOR] [COLOR {2}]Invalid Zip Url![/COLOR]'.
            format(CONFIG.COLOR1, name, CONFIG.COLOR2))
        return
    if not os.path.exists(CONFIG.PACKAGES):
        os.makedirs(CONFIG.PACKAGES)

    progress_dialog.create(
        CONFIG.ADDONTITLE,
        '[COLOR {0}][B]Downloading:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
            CONFIG.COLOR2, CONFIG.COLOR1,
            name), '', '[COLOR {0}]Please Wait[/COLOR]'.format(CONFIG.COLOR2))
    urlsplits = url.split('/')
    lib = os.path.join(CONFIG.PACKAGES, urlsplits[-1])
    try:
        os.remove(lib)
    except:
        pass
    Downloader().download(url, lib)
    title = '[COLOR {0}][B]Installing:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
        CONFIG.COLOR2, CONFIG.COLOR1, name)
    progress_dialog.update(
        0, title, '', '[COLOR {0}]Please Wait[/COLOR]'.format(CONFIG.COLOR2))
    percent, errors, error = extract.all(lib, CONFIG.ADDONS, title=title)
    progress_dialog.update(
        0, title, '',
        '[COLOR {0}]Installing Dependencies[/COLOR]'.format(CONFIG.COLOR2))
    installed(name)
    installlist = db.grab_addons(lib)
    logging.log(str(installlist))
    db.addon_database(installlist, 1, True)
    install_dependency(name, progress_dialog)
    progress_dialog.close()

    xbmc.executebuiltin('UpdateAddonRepos()')
    xbmc.executebuiltin('UpdateLocalAddons()')
    xbmc.executebuiltin('Container.Refresh()')

    for item in installlist:
        if item.startswith('skin.') and not item == 'skin.shortcuts':
            if not CONFIG.BUILDNAME == '' and CONFIG.DEFAULTIGNORE == 'true':
                CONFIG.set_setting('defaultskinignore', 'true')
            skin.switch_to_skin(item, 'Skin Installer')
예제 #5
0
    def install_skin(self, name, url):
        from resources.libs.downloader import Downloader
        from resources.libs import db
        from resources.libs import extract
        from resources.libs.common import logging
        from resources.libs import skin
        from resources.libs.common import tools

        progress_dialog = xbmcgui.DialogProgress()

        response = tools.open_url(url, check=False)

        if not response:
            logging.log_notify(
                "[COLOR {0}]Instalador de Add-ons[/COLOR]".format(
                    CONFIG.COLOR1),
                '[COLOR {0}]{1}:[/COLOR] [COLOR {2}]Url del Zip Inválida![/COLOR]'
                .format(CONFIG.COLOR1, name, CONFIG.COLOR2))
            return

        if not os.path.exists(CONFIG.PACKAGES):
            os.makedirs(CONFIG.PACKAGES)

        progress_dialog.create(
            CONFIG.ADDONTITLE,
            '[COLOR {0}][B]Descargando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.
            format(CONFIG.COLOR2, CONFIG.COLOR1, name) + '\n' + '' + '\n' +
            '[COLOR {0}]Espere por Favor[/COLOR]'.format(CONFIG.COLOR2))

        urlsplits = url.split('/')
        lib = xbmc.makeLegalFilename(
            os.path.join(CONFIG.PACKAGES, urlsplits[-1]))
        try:
            os.remove(lib)
        except:
            pass
        Downloader().download(url, lib)
        title = '[COLOR {0}][B]Instalando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
            CONFIG.COLOR2, CONFIG.COLOR1, name)
        progress_dialog.update(
            0, title + '\n' + '' + '\n' +
            '[COLOR {0}]Espere por Favor[/COLOR]'.format(CONFIG.COLOR2))
        percent, errors, error = extract.all(lib, CONFIG.HOME, title=title)
        installed = db.grab_addons(lib)
        db.addon_database(installed, 1, True)
        progress_dialog.close()
        logging.log_notify(
            "[COLOR {0}]Instalador de Add-ons[/COLOR]".format(CONFIG.COLOR1),
            '[COLOR {0}]{1}: Instalado![/COLOR]'.format(CONFIG.COLOR2, name))
        xbmc.executebuiltin('UpdateAddonRepos()')
        xbmc.executebuiltin('UpdateLocalAddons()')
        for item in installed:
            if item.startswith('skin.') and not item == 'skin.shortcuts':
                if not CONFIG.BUILDNAME == '' and CONFIG.DEFAULTIGNORE == 'true':
                    CONFIG.set_setting('defaultskinignore', 'true')
                skin.switch_to_skin(item, 'Skin Installer')
        xbmc.executebuiltin('Container.Refresh()')
예제 #6
0
    def install_addon_from_url(self, plugin, url):
        from resources.libs.downloader import Downloader
        from resources.libs import db
        from resources.libs import extract
        from resources.libs import skin

        response = tools.open_url(url, check=True)

        if not response:
            logging.log_notify(
                "[COLOR {0}]Instalador de Add-ons[/COLOR]".format(
                    CONFIG.COLOR1),
                '[COLOR {0}]{1}:[/COLOR] [COLOR {2}]URL inválido zip![/COLOR]'.
                format(CONFIG.COLOR1, plugin, CONFIG.COLOR2))
            return

        tools.ensure_folders(CONFIG.PACKAGES)

        self.progress_dialog.create(
            CONFIG.ADDONTITLE,
            '[COLOR {0}][B]Descargando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.
            format(CONFIG.COLOR2, CONFIG.COLOR1, plugin) + '\n' + '' + '\n' +
            '[COLOR {0}]Espere por Favor[/COLOR]'.format(CONFIG.COLOR2))
        urlsplits = url.split('/')
        lib = os.path.join(CONFIG.PACKAGES, urlsplits[-1])

        try:
            os.remove(lib)
        except:
            pass

        Downloader().download(url, lib)
        title = '[COLOR {0}][B]Instalando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
            CONFIG.COLOR2, CONFIG.COLOR1, plugin)
        self.progress_dialog.update(
            0, title + '\n' + '' + '\n' +
            '[COLOR {0}]Espere por Favor[/COLOR]'.format(CONFIG.COLOR2))
        percent, errors, error = extract.all(lib, CONFIG.ADDONS, title=title)
        self.progress_dialog.update(
            0, title + '\n' + '' + '\n' +
            '[COLOR {0}]Instalando Dependencias[/COLOR]'.format(CONFIG.COLOR2))
        installed(plugin)
        installlist = db.grab_addons(lib)
        logging.log(str(installlist))
        db.addon_database(installlist, 1, True)
        self.install_dependency(plugin)
        self.progress_dialog.close()

        xbmc.executebuiltin('UpdateAddonRepos()')
        xbmc.executebuiltin('UpdateLocalAddons()')
        xbmc.executebuiltin('Container.Refresh()')

        for item in installlist:
            if item.startswith('skin.') and not item == 'skin.shortcuts':
                if not CONFIG.BUILDNAME == '' and CONFIG.DEFAULTIGNORE == 'true':
                    CONFIG.set_setting('defaultskinignore', 'true')
                skin.switch_to_skin(item, 'Skin Installer')
예제 #7
0
    def theme(self, name, theme='', over=False):
        installtheme = False

        if not theme:
            themefile = check.check_build(name, 'theme')

            response = tools.open_url(themefile, check=True)
            if response:
                from resources.libs.gui.build_menu import BuildMenu
                themes = BuildMenu().theme_count(name, False)
                if len(themes) > 0:
                    if self.dialog.yesno(
                            CONFIG.ADDONTITLE,
                            "[COLOR {0}]The Build [COLOR {1}]{2}[/COLOR] comes with [COLOR {3}]{4}[/COLOR] different themes"
                            .format(CONFIG.COLOR2, CONFIG.COLOR1, name,
                                    CONFIG.COLOR1, len(themes)),
                            "Would you like to install one now?[/COLOR]",
                            yeslabel=
                            "[B][COLOR springgreen]Install Theme[/COLOR][/B]",
                            nolabel="[B][COLOR red]Cancel Themes[/COLOR][/B]"):
                        logging.log("Theme List: {0}".format(str(themes)))
                        ret = self.dialog.select(CONFIG.ADDONTITLE, themes)
                        logging.log("Theme install selected: {0}".format(ret))
                        if not ret == -1:
                            theme = themes[ret]
                            installtheme = True
                        else:
                            logging.log_notify(
                                CONFIG.ADDONTITLE,
                                '[COLOR {0}]Theme Install: Cancelled![/COLOR]'.
                                format(CONFIG.COLOR2))
                            return
                    else:
                        logging.log_notify(
                            CONFIG.ADDONTITLE,
                            '[COLOR {0}]Theme Install: Cancelled![/COLOR]'.
                            format(CONFIG.COLOR2))
                        return
            else:
                logging.log_notify(
                    CONFIG.ADDONTITLE,
                    '[COLOR {0}]Theme Install: None Found![/COLOR]'.format(
                        CONFIG.COLOR2))
        else:
            installtheme = self.dialog.yesno(
                CONFIG.ADDONTITLE,
                '[COLOR {0}]Would you like to install the theme:'.format(
                    CONFIG.COLOR2),
                '[COLOR {0}]{1}[/COLOR]'.format(CONFIG.COLOR1, theme),
                'for [COLOR {0}]{1} v{2}[/COLOR]?[/COLOR]'.format(
                    CONFIG.COLOR1, name, check.check_build(name, 'version')),
                yeslabel="[B][COLOR springgreen]Install Theme[/COLOR][/B]",
                nolabel="[B][COLOR red]Cancel Themes[/COLOR][/B]")

        if installtheme:
            themezip = check.check_theme(name, theme, 'url')
            zipname = name.replace('\\', '').replace('/', '').replace(
                ':',
                '').replace('*', '').replace('?', '').replace('"', '').replace(
                    '<', '').replace('>', '').replace('|', '')

            response = tools.open_url(themezip, check=True)
            if not response:
                logging.log_notify(
                    CONFIG.ADDONTITLE,
                    '[COLOR {0}]Theme Install: Invalid Zip Url![/COLOR]'.
                    format(CONFIG.COLOR2))
                return False

            self.dialogProgress.create(
                CONFIG.ADDONTITLE,
                '[COLOR {0}][B]Downloading:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'
                .format(CONFIG.COLOR2, CONFIG.COLOR1,
                        theme), '', 'Please Wait')

            lib = os.path.join(CONFIG.PACKAGES, '{0}.zip'.format(zipname))

            try:
                os.remove(lib)
            except:
                pass

            Downloader().download(themezip, lib)
            xbmc.sleep(500)

            if os.path.getsize(lib) == 0:
                try:
                    os.remove(lib)
                except:
                    pass

                return

            self.dialogProgress.update(0, "", "Installing {0}".format(name))

            test1 = False
            test2 = False

            from resources.libs import skin
            from resources.libs import test
            test1 = test.test_theme(
                lib) if CONFIG.SKIN not in skin.DEFAULT_SKINS else False
            test2 = test.test_gui(
                lib) if CONFIG.SKIN not in skin.DEFAULT_SKINS else False

            if test1:
                skin.look_and_feel_data('save')
                swap = skin.skin_to_default('Theme Install')

                if not swap:
                    return False

                xbmc.sleep(500)

            title = '[COLOR {0}][B]Installing Theme:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
                CONFIG.COLOR2, CONFIG.COLOR1, theme)
            self.dialogProgress.update(0, title, '', 'Please Wait')
            percent, errors, error = extract.all(lib, CONFIG.HOME, title=title)
            CONFIG.set_setting('buildtheme', theme)
            logging.log('INSTALLED {0}: [ERRORS:{1}]'.format(percent, errors))
            self.dialogProgress.close()

            db.force_check_updates(over=True)
            installed = db.grab_addons(lib)
            db.addon_database(installed, 1, True)

            if test2:
                skin.look_and_feel_data('save')
                skin.skin_to_default("Theme Install")
                gotoskin = CONFIG.get_setting('defaultskin')
                skin.switch_to_skin(gotoskin, "Theme Installer")
                skin.look_and_feel_data('restore')
            elif test1:
                skin.look_and_feel_data('save')
                skin.skin_to_default("Theme Install")
                gotoskin = CONFIG.get_setting('defaultskin')
                skin.switch_to_skin(gotoskin, "Theme Installer")
                skin.look_and_feel_data('restore')
            else:
                xbmc.executebuiltin("ReloadSkin()")
                xbmc.sleep(1000)
                xbmc.executebuiltin("Container.Refresh()")
        else:
            logging.log_notify(
                CONFIG.ADDONTITLE,
                '[COLOR {0}]Theme Install: Cancelled![/COLOR]'.format(
                    CONFIG.COLOR2))
예제 #8
0
def check_skin():
    from resources.libs.common import logging
    from resources.libs.common import tools

    dialog = xbmcgui.Dialog()

    logging.log("[Build Check] Invalid Skin Check Start")

    gotoskin = False
    if not CONFIG.DEFAULTSKIN == '':
        if os.path.exists(os.path.join(CONFIG.ADDONS, CONFIG.DEFAULTSKIN)):
            if dialog.yesno(
                    CONFIG.ADDONTITLE,
                    "[COLOR {0}]It seems that the skin has been set back to [COLOR {1}]{2}[/COLOR]"
                    .format(CONFIG.COLOR2, CONFIG.COLOR1,
                            CONFIG.SKIN[5:].title()),
                    "Would you like to set the skin back to:[/COLOR]",
                    '[COLOR {0}]{1}[/COLOR]'.format(CONFIG.COLOR1,
                                                    CONFIG.DEFAULTNAME)):
                gotoskin = CONFIG.DEFAULTSKIN
                gotoname = CONFIG.DEFAULTNAME
            else:
                logging.log("Skin was not reset")
                CONFIG.set_setting('defaultskinignore', 'true')
                gotoskin = False
        else:
            CONFIG.set_setting('defaultskin', '')
            CONFIG.set_setting('defaultskinname', '')
            CONFIG.DEFAULTSKIN = ''
            CONFIG.DEFAULTNAME = ''
    if CONFIG.DEFAULTSKIN == '':
        skinname = []
        skinlist = []
        for folder in glob.glob(os.path.join(CONFIG.ADDONS, 'skin.*/')):
            xml = "{0}/addon.xml".format(folder)
            if os.path.exists(xml):
                g = tools.read_from_file(xml).replace('\n', '').replace(
                    '\r', '').replace('\t', '')
                match = tools.parse_dom(g, 'addon', ret='id')
                match2 = tools.parse_dom(g, 'addon', ret='name')
                logging.log("{0}: {1}".format(folder, str(match[0])))
                if len(match) > 0:
                    skinlist.append(str(match[0]))
                    skinname.append(str(match2[0]))
                else:
                    logging.log("ID not found for {0}".format(folder))
            else:
                logging.log("ID not found for {0}".format(folder))
        if len(skinlist) > 0:
            if len(skinlist) > 1:
                if dialog.yesno(
                        CONFIG.ADDONTITLE,
                        "[COLOR {0}]It seems that the skin has been set back to [COLOR {1}]{2}[/COLOR]"
                        .format(CONFIG.COLOR2, CONFIG.COLOR1,
                                CONFIG.SKIN[5:].title()),
                        "Would you like to view a list of avaliable skins?[/COLOR]"
                ):
                    choice = dialog.select("Select skin to switch to!",
                                           skinname)
                    if choice == -1:
                        logging.log("Skin was not reset")
                        CONFIG.set_setting('defaultskinignore', 'true')
                    else:
                        gotoskin = skinlist[choice]
                        gotoname = skinname[choice]
                else:
                    logging.log("Skin was not reset")
                    CONFIG.set_setting('defaultskinignore', 'true')
            else:
                if dialog.yesno(
                        CONFIG.ADDONTITLE,
                        "[COLOR {0}]It seems that the skin has been set back to [COLOR {1}]{2}[/COLOR]"
                        .format(CONFIG.COLOR2, CONFIG.COLOR1,
                                CONFIG.SKIN[5:].title()),
                        "Would you like to set the skin back to:[/COLOR]",
                        '[COLOR {0}]{1}[/COLOR]'.format(
                            CONFIG.COLOR1, skinname[0])):
                    gotoskin = skinlist[0]
                    gotoname = skinname[0]
                else:
                    logging.log("Skin was not reset")
                    CONFIG.set_setting('defaultskinignore', 'true')
        else:
            logging.log("No skins found in addons folder.")
            CONFIG.set_setting('defaultskinignore', 'true')
            gotoskin = False
    if gotoskin:
        from resources.libs import skin

        if skin.switch_to_skin(gotoskin):
            skin.look_and_feel_data('restore')
    logging.log("[Build Check] Invalid Skin Check End")
예제 #9
0
def check_skin():
    from resources.libs.common import logging
    from resources.libs.common import tools

    dialog = xbmcgui.Dialog()

    logging.log(
        "[Verificación Build] Inicio de Comprobación del Skin Inválido")

    gotoskin = False
    if not CONFIG.DEFAULTSKIN == '':
        if os.path.exists(os.path.join(CONFIG.ADDONS, CONFIG.DEFAULTSKIN)):
            if dialog.yesno(
                    CONFIG.ADDONTITLE,
                    "[COLOR {0}]Parece que el skin se ha vuelto a poner [COLOR {1}]{2}[/COLOR]"
                    .format(CONFIG.COLOR2, CONFIG.COLOR1,
                            CONFIG.SKIN[5:].title()) + '\n' +
                    "Le gustaría volver a poner el skin en:[/COLOR]" +
                    '\n' + '[COLOR {0}]{1}[/COLOR]'.format(
                        CONFIG.COLOR1, CONFIG.DEFAULTNAME)):
                gotoskin = CONFIG.DEFAULTSKIN
                gotoname = CONFIG.DEFAULTNAME
            else:
                logging.log("El Skin no se reseteó")
                CONFIG.set_setting('defaultskinignore', 'true')
                gotoskin = False
        else:
            CONFIG.set_setting('defaultskin', '')
            CONFIG.set_setting('defaultskinname', '')
            CONFIG.DEFAULTSKIN = ''
            CONFIG.DEFAULTNAME = ''
    if CONFIG.DEFAULTSKIN == '':
        skinname = []
        skinlist = []
        for folder in glob.glob(os.path.join(CONFIG.ADDONS, 'skin.*/')):
            xml = "{0}/addon.xml".format(folder)
            if os.path.exists(xml):
                g = tools.read_from_file(xml).replace('\n', '').replace(
                    '\r', '').replace('\t', '')
                match = tools.parse_dom(g, 'addon', ret='id')
                match2 = tools.parse_dom(g, 'addon', ret='name')
                logging.log("{0}: {1}".format(folder, str(match[0])))
                if len(match) > 0:
                    skinlist.append(str(match[0]))
                    skinname.append(str(match2[0]))
                else:
                    logging.log("ID no encontrado para {0}".format(folder))
            else:
                logging.log("ID no encontrado para {0}".format(folder))
        if len(skinlist) > 0:
            if len(skinlist) > 1:
                if dialog.yesno(
                        CONFIG.ADDONTITLE,
                        "[COLOR {0}]Parece que el skin se ha vuelto a poner [COLOR {1}]{2}[/COLOR]"
                        .format(CONFIG.COLOR2, CONFIG.COLOR1,
                                CONFIG.SKIN[5:].title()) + '\n' +
                        "Le gustaría ver una lista de skins disponibles?[/COLOR]"
                ):
                    choice = dialog.select(
                        "Seleccione el skin para cambiarlo!", skinname)
                    if choice == -1:
                        logging.log("El Skin no se reseteó")
                        CONFIG.set_setting('defaultskinignore', 'true')
                    else:
                        gotoskin = skinlist[choice]
                        gotoname = skinname[choice]
                else:
                    logging.log("El Skin no se reseteó")
                    CONFIG.set_setting('defaultskinignore', 'true')
            else:
                if dialog.yesno(
                        CONFIG.ADDONTITLE,
                        "[COLOR {0}]Parece que el skin se ha vuelto a poner [COLOR {1}]{2}[/COLOR]"
                        .format(CONFIG.COLOR2, CONFIG.COLOR1,
                                CONFIG.SKIN[5:].title()) + '\n' +
                        "Le gustaría volver a poner el skin en:[/COLOR]" +
                        '\n' + '[COLOR {0}]{1}[/COLOR]'.format(
                            CONFIG.COLOR1, skinname[0])):
                    gotoskin = skinlist[0]
                    gotoname = skinname[0]
                else:
                    logging.log("El Skin no se reseteó")
                    CONFIG.set_setting('defaultskinignore', 'true')
        else:
            logging.log("No se encontraron skins en la carpeta de addons.")
            CONFIG.set_setting('defaultskinignore', 'true')
            gotoskin = False
    if gotoskin:
        from resources.libs import skin

        if skin.switch_to_skin(gotoskin):
            skin.look_and_feel_data('restore')
    logging.log("[Verificación Build] Fin de Comprobación del Skin Invalido")
예제 #10
0
    def install_skin(self, name, url):
        from resources.libs.downloader import Downloader
        from resources.libs import db
        from resources.libs import extract
        from resources.libs.common import logging
        from resources.libs import skin
        from resources.libs.common import tools
        if 78 - 78: O0.oO0o.II111iiii % OOooOOo
        O0oOoOOOoOO = xbmcgui.DialogProgress()
        if 49 - 49: Ii1I / OoO0O00.II111iiii
        oo0Ooo0 = tools.open_url(url, check=False)
        if 68 - 68: i11iIiiIii % I1ii11iIi11i + i11iIiiIii
        if not oo0Ooo0:
            logging.log_notify(
                "[COLOR {0}]Addon Installer[/COLOR]".format(CONFIG.COLOR1),
                '[COLOR {0}]{1}:[/COLOR] [COLOR {2}]Invalid Zip Url![/COLOR]'.
                format(CONFIG.COLOR1, name, CONFIG.COLOR2))
            return
            if 31 - 31: II111iiii.I1IiiI
        if not os.path.exists(CONFIG.PACKAGES):
            os.makedirs(CONFIG.PACKAGES)
            if 1 - 1: Oo0Ooo / o0oOOo0O0Ooo % o0OO0 * Oo0ooO0oo0oO.i11iIiiIii
        O0oOoOOOoOO.create(
            CONFIG.ADDONTITLE,
            '[COLOR {0}][B]Baixando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.
            format(CONFIG.COLOR2, CONFIG.COLOR1, name) + '\n' + '' + '\n' +
            '[COLOR {0}]Por favor, aguarde[/COLOR]'.format(CONFIG.COLOR2))
        if 2 - 2: I1ii11iIi11i * I11i - iIii1I11I1II1 + I1IiiI.oO0o % o0OO0
        Ii11Ii1I = url.split('/')
        O00oO = xbmc.makeLegalFilename(
            os.path.join(CONFIG.PACKAGES, Ii11Ii1I[-1]))
        try:
            os.remove(O00oO)
        except:
            pass
        Downloader().download(url, O00oO)
        I1 = '[COLOR {0}][B]Baixando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
            CONFIG.COLOR2, CONFIG.COLOR1, name)
        O0oOoOOOoOO.update(
            0, I1 + '\n' + '' + '\n' +
            '[COLOR {0}]Por favor, aguarde[/COLOR]'.format(CONFIG.COLOR2))
        OO00Oo, O0OOO0OOoO0O, O00Oo000ooO0 = extract.all(O00oO,
                                                         CONFIG.HOME,
                                                         title=I1)
        IiiIII111iI = db.grab_addons(O00oO)
        db.addon_database(IiiIII111iI, 1, True)
        O0oOoOOOoOO.close()
        logging.log_notify(
            "[COLOR {0}]Addon Installer[/COLOR]".format(CONFIG.COLOR1),
            '[COLOR {0}]{1}: Installed![/COLOR]'.format(CONFIG.COLOR2, name))
        xbmc.executebuiltin('UpdateAddonRepos()')
        xbmc.executebuiltin('UpdateLocalAddons()')
        for Oo0oOOo in IiiIII111iI:
            if Oo0oOOo.startswith('skin.') and not Oo0oOOo == 'skin.shortcuts':
                if not CONFIG.BUILDNAME == '' and CONFIG.DEFAULTIGNORE == 'true':
                    CONFIG.set_setting('defaultskinignore', 'true')
                skin.switch_to_skin(Oo0oOOo, 'Skin Installer')
        xbmc.executebuiltin('Container.Refresh()')


# Team KelTec Media'Play
예제 #11
0
 def install_addon_from_url(self, plugin, url):
     from resources.libs.downloader import Downloader
     from resources.libs import db
     from resources.libs import extract
     from resources.libs import skin
     if 50 - 50: I1IiiI
     oo0Ooo0 = tools.open_url(url, check=True)
     if 34 - 34: I1IiiI * II111iiii % o0OO0 * OoOoOO00 - I1IiiI
     if not oo0Ooo0:
         logging.log_notify(
             "[COLOR {0}]Addon Installer[/COLOR]".format(CONFIG.COLOR1),
             '[COLOR {0}]{1}:[/COLOR] [COLOR {2}]Invalid Zip Url![/COLOR]'.
             format(CONFIG.COLOR1, plugin, CONFIG.COLOR2))
         return
         if 33 - 33: o0oOOo0O0Ooo + OOooOOo * OoO0O00 - Oo0Ooo / oO0o % Ii1I
     tools.ensure_folders(CONFIG.PACKAGES)
     if 21 - 21: OoO0O00 * iIii1I11I1II1 % oO0o * i1IIi
     self.progress_dialog.create(
         CONFIG.ADDONTITLE,
         '[COLOR {0}][B]Baixando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.
         format(CONFIG.COLOR2, CONFIG.COLOR1, plugin) + '\n' + '' + '\n' +
         '[COLOR {0}]Por favor, aguarde[/COLOR]'.format(CONFIG.COLOR2))
     Ii11Ii1I = url.split('/')
     O00oO = os.path.join(CONFIG.PACKAGES, Ii11Ii1I[-1])
     if 39 - 39:
         Oo0ooO0oo0oO - II111iiii * OoO0O00 % o0oOOo0O0Ooo * II111iiii % II111iiii
     try:
         os.remove(O00oO)
     except:
         pass
         if 59 - 59:
             iIii1I11I1II1 + I1IiiI - o0oOOo0O0Ooo - I1IiiI + OOooOOo / I1ii11iIi11i
     Downloader().download(url, O00oO)
     I1 = '[COLOR {0}][B]Baixando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
         CONFIG.COLOR2, CONFIG.COLOR1, plugin)
     self.progress_dialog.update(
         0, I1 + '\n' + '' + '\n' +
         '[COLOR {0}]Por favor, aguarde[/COLOR]'.format(CONFIG.COLOR2))
     OO00Oo, O0OOO0OOoO0O, O00Oo000ooO0 = extract.all(O00oO,
                                                      CONFIG.ADDONS,
                                                      title=I1)
     self.progress_dialog.update(
         0, I1 + '\n' + '' + '\n' +
         '[COLOR {0}]Baixando Dependencies[/COLOR]'.format(CONFIG.COLOR2))
     IiiIII111iI(plugin)
     OoO0O00IIiII = db.grab_addons(O00oO)
     logging.log(str(OoO0O00IIiII))
     db.addon_database(OoO0O00IIiII, 1, True)
     self.install_dependency(plugin)
     self.progress_dialog.close()
     if 80 - 80: Oo0ooO0oo0oO.oO0o
     xbmc.executebuiltin('UpdateAddonRepos()')
     xbmc.executebuiltin('UpdateLocalAddons()')
     xbmc.executebuiltin('Container.Refresh()')
     if 25 - 25: OoOoOO00.II111iiii / o0OO0.OOooOOo * OoO0O00.I1IiiI
     for Oo0oOOo in OoO0O00IIiII:
         if Oo0oOOo.startswith('skin.') and not Oo0oOOo == 'skin.shortcuts':
             if not CONFIG.BUILDNAME == '' and CONFIG.DEFAULTIGNORE == 'true':
                 CONFIG.set_setting('defaultskinignore', 'true')
             skin.switch_to_skin(Oo0oOOo, 'Skin Installer')
             if 58 - 58: II111iiii * OOooOOo * I1ii11iIi11i / OOooOOo