Пример #1
0
    def gui(self, name, over=False):
        if name == CONFIG.get_setting('buildname'):
            if over:
                yes_pressed = 1
            else:
                yes_pressed = self.dialog.yesno(CONFIG.ADDONTITLE,
                                   '[COLOR {0}]Would you like to apply the guifix for:'.format(CONFIG.COLOR2) + '\n' + '[COLOR {0}]{1}[/COLOR]?[/COLOR]'.format(CONFIG.COLOR1, name),
                                   nolabel='[B][COLOR red]No, Cancel[/COLOR][/B]',
                                   yeslabel='[B][COLOR springgreen]Apply Fix[/COLOR][/B]')
        else:
            yes_pressed = self.dialog.yesno("{0} - [COLOR red]WARNING!![/COLOR]".format(CONFIG.ADDONTITLE),
                               "[COLOR {0}][COLOR {1}]{2}[/COLOR] community build is not currently installed.".format(CONFIG.COLOR2, CONFIG.COLOR1, name) + '\n' + "Would you like to apply the guiFix anyways?.[/COLOR]",
                               nolabel='[B][COLOR red]No, Cancel[/COLOR][/B]',
                               yeslabel='[B][COLOR springgreen]Apply Fix[/COLOR][/B]')
        if yes_pressed:
            guizip = check.check_build(name, 'gui')
            zipname = name.replace('\\', '').replace('/', '').replace(':', '').replace('*', '').replace('?', '').replace('"', '').replace('<', '').replace('>', '').replace('|', '')

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

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

            lib = os.path.join(CONFIG.PACKAGES, '{0}_guisettings.zip'.format(zipname))
            
            try:
                os.remove(lib)
            except:
                pass

            Downloader().download(guizip, lib)
            xbmc.sleep(500)
            
            if os.path.getsize(lib) == 0:
                try:
                    os.remove(lib)
                except:
                    pass
                    
                return
            
            title = '[COLOR {0}][B]Installing:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(CONFIG.COLOR2, CONFIG.COLOR1, name)
            self.dialogProgress.update(0, title + '\n' + 'Please Wait')
            extract.all(lib, CONFIG.USERDATA, title=title)
            self.dialogProgress.close()
            skin.skin_to_default('Build Install')
            skin.look_and_feel_data('save')
            installed = db.grab_addons(lib)
            db.addon_database(installed, 1, True)

            self.dialog.ok(CONFIG.ADDONTITLE, "[COLOR {0}]To save changes you now need to force close Kodi, Press OK to force close Kodi[/COLOR]".format(CONFIG.COLOR2))
            tools.kill_kodi(over=True)
        else:
            logging.log_notify(CONFIG.ADDONTITLE,
                               '[COLOR {0}]GuiFix: Cancelled![/COLOR]'.format(CONFIG.COLOR2))
Пример #2
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()')
Пример #3
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')
Пример #4
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')
Пример #5
0
 def install_addon_pack(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.common import tools
     if 64 - 64: o00ooo0 / OoOoOO00 - O0 - I11i
     O0oOoOOOoOO = xbmcgui.DialogProgress()
     if 38 - 38: I1i1iI1i
     oo0Ooo0 = tools.open_url(url, check=True)
     if 7 - 7: O0.o0OO0 % I1ii11iIi11i - I1IiiI - iIii1I11I1II1
     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 36 - 36: Oo0ooO0oo0oO % o00ooo0 % Oo0Ooo - I1ii11iIi11i
     if not os.path.exists(CONFIG.PACKAGES):
         os.makedirs(CONFIG.PACKAGES)
         if 22 - 22: iIii1I11I1II1 / Oo0Ooo * I1ii11iIi11i % o0OO0
     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))
     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.ADDONS,
                                                      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}: Instalado![/COLOR]'.format(CONFIG.COLOR2, name))
     xbmc.executebuiltin('UpdateAddonRepos()')
     xbmc.executebuiltin('UpdateLocalAddons()')
     xbmc.executebuiltin('Container.Refresh()')
     if 85 - 85: oO0o % i11iIiiIii - o0OO0 * OoooooooOO / I1IiiI % I1IiiI
     if 1 - 1: OoO0O00 - oO0o.I11i.OoO0O00 / Oo0Ooo + I11i
Пример #6
0
    def install_addon_pack(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.common import tools

        progress_dialog = xbmcgui.DialogProgress()

        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 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.ADDONS, 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()')
        xbmc.executebuiltin('Container.Refresh()')
Пример #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)) + '\n' +
                            "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) + ' \n' +
                '[COLOR {0}]{1}[/COLOR]'.format(CONFIG.COLOR1, theme) + '\n' +
                '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, zipname) + ' \n' +
                '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, '\n' + "Installing {0}".format(name))

            title = '[COLOR {0}][B]Installing Theme:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
                CONFIG.COLOR2, CONFIG.COLOR1, theme)
            self.dialogProgress.update(0, title + '\n' + '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)
            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 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}][B]La Build [COLOR {1}]{2}[/COLOR] viene con [COLOR {3}]{4}[/COLOR] Parches diferentes[/B]"
                            .format(CONFIG.COLOR2, CONFIG.COLOR1, name,
                                    CONFIG.COLOR1, len(themes)) + '\n\n' +
                            "Le gustaria instalar uno ahora?[/COLOR]",
                            yeslabel=
                            "[B][COLOR cyan]Instalar Parche[/COLOR][/B]",
                            nolabel="[B][COLOR red]Cancelar Parche[/COLOR][/B]"
                    ):
                        logging.log("Lista de Parches: {0}".format(
                            str(themes)))
                        ret = self.dialog.select(CONFIG.ADDONTITLE, themes)
                        logging.log(
                            "[B]Selecciona un Parche para Instalar:[/B] {0}".
                            format(ret))
                        if not ret == -1:
                            theme = themes[ret]
                            installtheme = True
                        else:
                            logging.log_notify(
                                CONFIG.ADDONTITLE,
                                '[COLOR {0}]Instalación:[/COLOR] [COLOR gold]Cancelado![/COLOR]'
                                .format(CONFIG.COLOR2))
                            return
                    else:
                        logging.log_notify(
                            CONFIG.ADDONTITLE,
                            '[COLOR {0}]Instalación Parche:[/COLOR] [COLOR gold]Cancelado![/COLOR]'
                            .format(CONFIG.COLOR2))
                        return
            else:
                logging.log_notify(
                    CONFIG.ADDONTITLE,
                    '[COLOR {0}]Instalación Parche:[/COLOR] [COLOR gold]Nada Encontrado![/COLOR]'
                    .format(CONFIG.COLOR2))
        else:
            installtheme = self.dialog.yesno(
                CONFIG.ADDONTITLE,
                '[COLOR {0}][B]Te gustaría instalar uno de los Parches que hay en:[/B]'
                .format(CONFIG.COLOR2) + ' \n' +
                '[COLOR dodgerblue][B]PARCHES MATRIX[/B][/COLOR]'.format(
                    CONFIG.COLOR1, theme) + '\n' +
                '[B]para [COLOR {0}]{1} v{2}[/COLOR]?[/B][/COLOR]'.format(
                    CONFIG.COLOR1, name, check.check_build(name, 'version')),
                yeslabel="[B][COLOR cyan]Instalar Parche[/COLOR][/B]",
                nolabel="[B][COLOR red]Cancelar Parche[/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}]Instalación Parche:[/COLOR] [COLOR gold]Url Zip Inválido![/COLOR]'
                    .format(CONFIG.COLOR2))
                return False

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

            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, '\n' + "Instalando {0}".format(name))
            from resources.libs import skin
            from resources.libs import test
            title = '[COLOR {0}][B]Instalando Parche:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
                CONFIG.COLOR2, CONFIG.COLOR1, theme)
            self.dialogProgress.update(0, title + '\n' + 'Espere por Favor')
            percent, errors, error = extract.all(lib, CONFIG.HOME, title=title)
            CONFIG.set_setting('buildtheme', theme)
            logging.log('INSTALADO {0}: [ERRORES:{1}]'.format(percent, errors))
            self.dialogProgress.close()
            installed = db.grab_addons(lib)
            db.addon_database(installed, 1, True)
            xbmc.executebuiltin("ReloadSkin()")
            xbmc.sleep(1000)
            xbmc.executebuiltin("Container.Refresh()")
        else:
            logging.log_notify(
                CONFIG.ADDONTITLE,
                '[COLOR {0}]Instalación Parche:[/COLOR] [COLOR gold]Cancelado![/COLOR]'
                .format(CONFIG.COLOR2))
Пример #9
0
    def gui(self, name, over=False):
        if name == CONFIG.get_setting('buildname'):
            if over:
                yes_pressed = 1
            else:
                yes_pressed = self.dialog.yesno(
                    CONFIG.ADDONTITLE,
                    '[COLOR {0}]Le gustaria aplicar la correccion de interfaz gráfica de usuario para:'
                    .format(CONFIG.COLOR2) + '\n' +
                    '[COLOR {0}]{1}[/COLOR]?[/COLOR]'.format(
                        CONFIG.COLOR1, name),
                    nolabel='[B][COLOR red]No, Cancelar[/COLOR][/B]',
                    yeslabel=
                    '[B][COLOR springgreen]Aplicar Correccion[/COLOR][/B]')
        else:
            yes_pressed = self.dialog.yesno(
                "[B]{0} - [COLOR red]ADVERTENCIA!![/COLOR][/B]".format(
                    CONFIG.ADDONTITLE),
                "[COLOR {0}][COLOR {1}]{2}[/COLOR] [B]La Build de la comunidad no está instalada actualmente."
                .format(CONFIG.COLOR2, CONFIG.COLOR1, name) + '\n' +
                "Le gustaría aplicar la Corrección Gui ([COLOR azure]de la interfaz gráfica de usuario[/COLOR]) de todos modos?[/B][/COLOR]",
                nolabel='[B][COLOR red]No, Cancelar[/COLOR][/B]',
                yeslabel='[B][COLOR springgreen]Aplicar Correccion[/COLOR][/B]'
            )
        if yes_pressed:
            guizip = check.check_build(name, 'gui')
            zipname = name.replace('\\', '').replace('/', '').replace(
                ':',
                '').replace('*', '').replace('?', '').replace('"', '').replace(
                    '<', '').replace('>', '').replace('|', '')

            response = tools.open_url(guizip, check=True)
            if not response:
                logging.log_notify(
                    CONFIG.ADDONTITLE,
                    '[COLOR {0}]Corrección Gui: Url Zip Inválido![/COLOR]'.
                    format(CONFIG.COLOR2))
                return

            self.dialogProgress.create(
                CONFIG.ADDONTITLE,
                '[COLOR {0}][B]Descargando Correccion Gui:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'
                .format(CONFIG.COLOR2, CONFIG.COLOR1,
                        name), '', 'Espere por Favor')

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

            try:
                os.remove(lib)
            except:
                pass

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

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

                return

            title = '[COLOR {0}][B]Instalando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
                CONFIG.COLOR2, CONFIG.COLOR1, name)
            self.dialogProgress.update(0, title + '\n' + 'Espere por Favor')
            extract.all(lib, CONFIG.USERDATA, title=title)
            self.dialogProgress.close()
            skin.skin_to_default('Build Install')
            skin.look_and_feel_data('save')
            installed = db.grab_addons(lib)
            db.addon_database(installed, 1, True)

            self.dialog.ok(
                CONFIG.ADDONTITLE,
                "[COLOR {0}][B]Para guardar los cambios, ahora necesita Forzar el Cierre de Kodi.[/B] \n\nPresione [B]OK[/B] para Forzar el Cierre de Kodi.[/COLOR]"
                .format(CONFIG.COLOR2))
            tools.kill_kodi(over=True)
        else:
            logging.log_notify(
                CONFIG.ADDONTITLE,
                '[COLOR {0}]Corrección Gui:[/COLOR] [COLOR gold]Cancelado![/COLOR]'
                .format(CONFIG.COLOR2))
Пример #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