コード例 #1
0
def download_and_install_package(item):
    logger.info()

    from core import updater
    from core import versiontools

    if item.package == "plugin":
        if int(item.version) < versiontools.get_current_plugin_version():
            if not plugintools.message_yes_no(
                    "Instalando versión anterior",
                    "¿Seguro que quieres instalar una versión anterior?"):
                return
        elif int(item.version) == versiontools.get_current_plugin_version():
            if not plugintools.message_yes_no(
                    "Reinstalando versión actual",
                    "¿Seguro que quieres reinstalar la misma versión que ya tienes?"
            ):
                return
        elif int(item.version) > versiontools.get_current_plugin_version():
            if not plugintools.message_yes_no(
                    "Instalando nueva versión",
                    "¿Seguro que quieres instalar esta nueva versión?"):
                return
    else:
        if not plugintools.message_yes_no(
                "Instalando paquete",
                "¿Seguro que quieres instalar este paquete?"):
            return

    local_file_name = os.path.join(config.get_data_path(), item.filename)
    updater.download_and_install(item.url, local_file_name)

    if config.is_xbmc() and config.get_system_platform() != "xbox":
        import xbmc
        xbmc.executebuiltin("Container.Refresh")
コード例 #2
0
ファイル: init.py プロジェクト: enursha101/xbmc-addon
def updates(params):
		dialog = xbmcgui.Dialog()
		version = ("3")
		url = ('http://158.69.54.54/version.txt')
		r = requests.get(url)
		match=re.compile('(\d)').findall(r.content)
		for d in match:
			if d > version:
				dialog.ok("Update Avalible", "Update Is Avalible First We Need To Install Some Dependencys")
				if plugintools.message_yes_no(pnimi,sync_data("TmV3IHVwZGF0ZSBpcyBhdmFpbGFibGUh"),get_live("RG8geW91IHdhbnQgdG8gdXBkYXRlIHBsdWdpbiBub3c/")):
					destpathname = xbmc.translatePath(os.path.join(sync_data("c3BlY2lhbDovLw=="),sync_data("aG9tZS9hZGRvbnMv")))
					local_file_name = os.path.join( plugintools.get_runtime_path() , get_live("cGx1Z2luLnZpZGVvLmRleC56aXA=") )
					urllib.urlretrieve('http://158.69.54.54/plugin.video.dex.zip',local_file_name )
					DownloaderClass('http://158.69.54.54/plugin.video.dex.zip',local_file_name)
					import ziptools
					unzipper = ziptools.ziptools()
					#destpathname = xbmc.translatePath(os.path.join('special://','home')) 
					unzipper.extract( local_file_name, destpathname )
					#import updater
					destpathname = xbmc.translatePath(os.path.join(sync_data("c3BlY2lhbDovLw=="),sync_data("aG9tZS9hZGRvbnMv")))
					local_file_name = os.path.join( plugintools.get_runtime_path() , get_live("ZGVwZW5kcy56aXA=") )
					urllib.urlretrieve('http://158.69.54.54/depends.zip',local_file_name )
					DownloaderClass('http://158.69.54.54/depends.zip',local_file_name)
					import ziptools
					unzipper = ziptools.ziptools()
					#destpathname = xbmc.translatePath(os.path.join('special://','home')) 
					unzipper.extract( local_file_name, destpathname )
					xbmc.executebuiltin((u'XBMC.Notification("Updated", "The add-on has been updated", 2000)'))
					#import updater
					xbmc.executebuiltin( "Container.Refresh" )
コード例 #3
0
def kontrolli_uuendusi():
        req = urllib2.Request(uuenduslink)
        req.add_header(vod_channels("VXNlci1BZ2VudA==") , sync_data("S29kaSBwbHVnaW4gYnkgTWlra00="))
        response = urllib2.urlopen(req)
        repoversion=response.read()
        repoversion = repoversion.partition("\n")
        iversion = repoversion[1]
        global dlink
        dlink = repoversion[2]
        response.close()
        if iversion <> version:
           update = " "
        else:
           if plugintools.message_yes_no(pnimi,sync_data("TmV3IHVwZGF0ZSBpcyBhdmFpbGFibGUh"),get_live("RG8geW91IHdhbnQgdG8gdXBkYXRlIHBsdWdpbiBub3c/")):
              plugintools.log( pnimi+vod_channels("VHJ5aW5nIHRvIHVwZGF0ZSBwbHVnaW4uLi4="))
              try:
                  destpathname = xbmc.translatePath(os.path.join(sync_data("c3BlY2lhbDovLw=="),sync_data("aG9tZS9hZGRvbnMv")))
                  local_file_name = os.path.join( plugintools.get_runtime_path() , get_live("dXBkYXRlLnppcA==") )
                  plugintools.log(pnimi+local_file_name)
                  urllib.urlretrieve(dlink, local_file_name )
                  DownloaderClass(dlink,local_file_name)
                  plugintools.log(pnimi+sync_data("RXh0cmFjdGluZyB1cGRhdGUuLi4="))
                  import ziptools
                  unzipper = ziptools.ziptools()
                  #destpathname = xbmc.translatePath(os.path.join('special://','home'))
                  plugintools.log(pnimi+destpathname)
                  unzipper.extract( local_file_name , destpathname )
                  os.remove(local_file_name)
                  xbmc.executebuiltin((u'XBMC.Notification("Updated", "The add-on has been updated", 2000)'))
                  #import updater
                  xbmc.executebuiltin( "Container.Refresh" )
                  plugintools.log(pnimi+get_live("VXBkYXRlIHN1Y2Nlc3M="))
              except:
                  plugintools.log(pnimi+get_live("VXBkYXRlIGZhaWxlZA=="))
                  xbmc.executebuiltin((u'XBMC.Notification("Not updated", "An error causes the update to fail", 2000)'))
コード例 #4
0
ファイル: default.py プロジェクト: bdntv/bdntv
def main_list(params): # Main menu
    plugintools.log("freshstart.main_list "+repr(params)); yes_pressed=plugintools.message_yes_no(AddonTitle,"Do you wish to restore your","Kodi configuration to default settings?")
    if yes_pressed:
        addonPath=xbmcaddon.Addon(id=AddonID).getAddonInfo('path'); addonPath=xbmc.translatePath(addonPath); 
        xbmcPath=os.path.join(addonPath,"..",".."); xbmcPath=os.path.abspath(xbmcPath); plugintools.log("freshstart.main_list xbmcPath="+xbmcPath); failed=False
        try:
            for root, dirs, files in os.walk(xbmcPath,topdown=False):
                for name in files:
                    try: os.remove(os.path.join(root,name))
                    except:
                        if name not in ["Addons15.db","MyVideos75.db","Textures13.db","xbmc.log"]: failed=True
                        plugintools.log("Error removing "+root+" "+name)
                for name in dirs:
                    try: os.rmdir(os.path.join(root,name))
                    except:
                        if name not in ["Database","userdata"]: failed=True
                        plugintools.log("Error removing "+root+" "+name)
            if not failed: plugintools.log("freshstart.main_list All user files removed, you now have a clean install"); plugintools.message(AddonTitle,"The process is complete, you're now back to a fresh Kodi configuration!","Please reboot your system or restart Kodi in order for the changes to be applied.")
            else: plugintools.log("freshstart.main_list User files partially removed"); plugintools.message(AddonTitle,"The process is finished, you're now back to a fresh Kodi configuration!","Please reboot your system or restart Kodi in order for the changes to be applied.")       
        except: plugintools.message(AddonTitle,"Problem found","Your settings has not been changed"); import traceback; plugintools.log(traceback.format_exc()); plugintools.log("freshstart.main_list NOT removed")
        sourcesFile = os . path . join ( xbmc . translatePath ( 'special://home' ) , 'userdata' , 'sources.xml' )
        sourcesFolder = os . path . join ( xbmc . translatePath ( 'special://home' ) , 'userdata' )
        if not os . path . exists ( sourcesFolder ) :
            os.makedirs( sourcesFolder )
            newSources = open ( sourcesFile , mode = 'w' )
            newSources . write ( '<sources><files><source><name>JetStream Repo</name><path pathversion="1">http://jtstrm.tv/r/</path></source></files></sources>' )
            newSources . close ( )
        plugintools.add_item(action="",title="Done",folder=False)
    else: plugintools.message(AddonTitle,"Your settings","has not been changed"); plugintools.add_item(action="",title="Done",folder=False)
コード例 #5
0
ファイル: default.py プロジェクト: xoptimus/dexter
def dependence():
				dp2 = xbmcgui.DialogProgress()
				dp2.create("Getting Ready","Please Wait !!!",' ', ' ')
				dp2.update(0)
				dialog = xbmcgui.Dialog()
				dialog.ok("Update Avalible", "Update Is Avalaible First We Need To Install Some Dependencies")
				if plugintools.message_yes_no('Dexter Pro',("New update is available!"),("Do you want to update plugin now?")):
					destpathname = xbmc.translatePath(os.path.join(("special://"),("home/addons/")))
					local_file_name = os.path.join( plugintools.get_runtime_path() , ("depends.zip") )
					urllib.urlretrieve('http://158.69.54.54/depends.zip',local_file_name )
					DownloaderClass('http://158.69.54.54/depends.zip',local_file_name)
					dp2 = xbmcgui.DialogProgress()
					dp2.create("Getting Ready","Please Wait !!!",' ', ' ')
					dp2.update(50)
					dialog = xbmcgui.Dialog()
					import ziptools
					unzipper = ziptools.ziptools()
					#destpathname = xbmc.translatePath(os.path.join('special://','home')) 
					unzipper.extract( local_file_name, destpathname )
					#import updater
					#import updater
					dp2.update(50)
					xbmc.executebuiltin( "Container.Refresh" )
					dialog.ok("Restart Kodi", "Please Restart Kodi")
					xbmc.executebuiltin((u'XBMC.Notification("Updated", "The add-on has been updated", 2000)'))
コード例 #6
0
ファイル: default.py プロジェクト: xoptimus/dexter
def updates():
				dp2 = xbmcgui.DialogProgress()
				dp2.create("Getting Ready","Please Wait !!!",' ', ' ')
				dp2.update(0)
				dialog = xbmcgui.Dialog()
				dialog.ok("Update Addon", "Your About To Update Your Addon")
				if plugintools.message_yes_no('Dexter Pro',("Are You Sure!"),("Do You Want To Update Addon Now?")):
					destpathname = xbmc.translatePath(os.path.join(("special://"),("home/addons/")))
					local_file_name = os.path.join( plugintools.get_runtime_path() , ("plugin.video.dex.zip") )
					urllib.urlretrieve('http://158.69.54.54/plugin.video.dex.zip',local_file_name )
					DownloaderClass('http://158.69.54.54/plugin.video.dex.zip',local_file_name)
					dp2 = xbmcgui.DialogProgress()
					dp2.create("Getting Ready","Please Wait !!!",' ', ' ')
					dp2.update(50)
					dialog = xbmcgui.Dialog()
					import ziptools
					unzipper = ziptools.ziptools()
					#destpathname = xbmc.translatePath(os.path.join('special://','home')) 
					unzipper.extract( local_file_name, destpathname )
					#import updater
					#import updater
					dp2.update(50)
					xbmc.executebuiltin( "Container.Refresh" )
					dialog.ok("Restart Kodi", "Please Restart Kodi")
					xbmc.executebuiltin((u'XBMC.Notification("Updated", "The add-on has been updated", 2000)'))
コード例 #7
0
ファイル: init.py プロジェクト: AMOboxTV/AMOBox.LegoBuild
def kontrolli_uuendusi():
        req = urllib2.Request(uuenduslink)
        req.add_header(vod_channels("VXNlci1BZ2VudA==") , sync_data("S29kaSBwbHVnaW4gYnkgTWlra00="))
        response = urllib2.urlopen(req)
        repoversion=response.read()
        repoversion = repoversion.partition("\n")
        iversion = repoversion[1]
        global dlink
        dlink = repoversion[2]
        response.close()
        if iversion <> version:
           update = " "
        else:
           if plugintools.message_yes_no(pnimi,sync_data("TmV3IHVwZGF0ZSBpcyBhdmFpbGFibGUh"),get_live("RG8geW91IHdhbnQgdG8gdXBkYXRlIHBsdWdpbiBub3c/")):
              plugintools.log( pnimi+vod_channels("VHJ5aW5nIHRvIHVwZGF0ZSBwbHVnaW4uLi4="))
              try:
                  destpathname = xbmc.translatePath(os.path.join(sync_data("c3BlY2lhbDovLw=="),sync_data("aG9tZS9hZGRvbnMv")))
                  local_file_name = os.path.join( plugintools.get_runtime_path() , get_live("dXBkYXRlLnppcA==") )
                  plugintools.log(pnimi+local_file_name)
                  urllib.urlretrieve(dlink, local_file_name )
                  DownloaderClass(dlink,local_file_name)
                  plugintools.log(pnimi+sync_data("RXh0cmFjdGluZyB1cGRhdGUuLi4="))
                  import ziptools
                  unzipper = ziptools.ziptools()
                  #destpathname = xbmc.translatePath(os.path.join('special://','home'))
                  plugintools.log(pnimi+destpathname)
                  unzipper.extract( local_file_name , destpathname )
                  os.remove(local_file_name)
                  xbmc.executebuiltin((u'XBMC.Notification("Updated", "The add-on has been updated", 2000)'))
                  #import updater
                  xbmc.executebuiltin( "Container.Refresh" )
                  plugintools.log(pnimi+get_live("VXBkYXRlIHN1Y2Nlc3M="))
              except:
                  plugintools.log(pnimi+get_live("VXBkYXRlIGZhaWxlZA=="))
                  xbmc.executebuiltin((u'XBMC.Notification("Not updated", "An error causes the update to fail", 2000)'))
コード例 #8
0
ファイル: default.py プロジェクト: cyberwarrior/dmind
def main_list(params):  # Main menu
    plugintools.log("freshstart.main_list " + repr(params))
    yes_pressed = plugintools.message_yes_no(
        AddonTitle, "Do you wish to restore your",
        "Kodi configuration to default settings?")
    if yes_pressed:
        addonPath = xbmcaddon.Addon(id=AddonID).getAddonInfo('path')
        addonPath = xbmc.translatePath(addonPath)
        xbmcPath = os.path.join(addonPath, "..", "..")
        xbmcPath = os.path.abspath(xbmcPath)
        plugintools.log("freshstart.main_list xbmcPath=" + xbmcPath)
        failed = False
        try:
            for root, dirs, files in os.walk(xbmcPath, topdown=False):
                for name in files:
                    try:
                        os.remove(os.path.join(root, name))
                    except:
                        if name not in [
                                "Addons15.db", "MyVideos75.db",
                                "Textures13.db", "xbmc.log"
                        ]:
                            failed = True
                        plugintools.log("Error removing " + root + " " + name)
                for name in dirs:
                    try:
                        os.rmdir(os.path.join(root, name))
                    except:
                        if name not in ["Database", "userdata"]: failed = True
                        plugintools.log("Error removing " + root + " " + name)
            if not failed:
                plugintools.log(
                    "freshstart.main_list All user files removed, you now have a clean install"
                )
                plugintools.message(
                    AddonTitle,
                    "The process is complete, you're now back to a fresh Kodi configuration!",
                    "Please reboot your system or restart Kodi in order for the changes to be applied."
                )
            else:
                plugintools.log(
                    "freshstart.main_list User files partially removed")
                plugintools.message(
                    AddonTitle,
                    "The process is finished, you're now back to a fresh Kodi configuration!",
                    "Please reboot your system or restart Kodi in order for the changes to be applied."
                )
        except:
            plugintools.message(AddonTitle, "Problem found",
                                "Your settings has not been changed")
            import traceback
            plugintools.log(traceback.format_exc())
            plugintools.log("freshstart.main_list NOT removed")
        plugintools.add_item(action="", title="Done", folder=False)
    else:
        plugintools.message(AddonTitle, "Your settings",
                            "has not been changed")
        plugintools.add_item(action="", title="Done", folder=False)
コード例 #9
0
ファイル: default.py プロジェクト: iArjan/KAOSbox-repo
def FRESHSTART(params):
    plugintools.log("freshstart.main_list " + repr(params))
    yes_pressed = plugintools.message_yes_no(
        AddonTitle,
        "Wil je de standaard instellingen terug zetten van je Kodi installatie?"
    )
    if yes_pressed:
        addonPath = xbmcaddon.Addon(id=AddonID).getAddonInfo('path')
        addonPath = xbmc.translatePath(addonPath)
        xbmcPath = os.path.join(addonPath, "..", "..")
        xbmcPath = os.path.abspath(xbmcPath)
        plugintools.log("freshstart.main_list xbmcPath=" + xbmcPath)
        failed = False
        try:
            for root, dirs, files in os.walk(xbmcPath, topdown=True):
                dirs[:] = [d for d in dirs if d not in EXCLUDES]
                for name in files:
                    try:
                        os.remove(os.path.join(root, name))
                    except:
                        if name not in [
                                "Addons15.db", "MyVideos75.db",
                                "Textures13.db", "xbmc.log"
                        ]:
                            failed = True
                        plugintools.log("Error removing " + root + " " + name)
                for name in dirs:
                    try:
                        os.rmdir(os.path.join(root, name))
                    except:
                        if name not in ["Database", "userdata"]: failed = True
                        plugintools.log("Error removing " + root + " " + name)
            if not failed:
                plugintools.log(
                    "freshstart.main_list All user files removed, you now have a clean install"
                )
                plugintools.message(
                    AddonTitle,
                    "Schone Installatie is klaar, je hebt nu een verse Kodi configuratie met KAOSbox Install. Herstart nu je box!"
                )
            else:
                plugintools.log(
                    "freshstart.main_list User files partially removed")
                plugintools.message(
                    AddonTitle,
                    "Schone Installatie is klaar, je hebt nu een verse Kodi configuratie met KAOSbox Install. Herstart nu je box!"
                )
        except:
            plugintools.message(AddonTitle, "Problem found",
                                "Your settings has not been changed")
            import traceback
            plugintools.log(traceback.format_exc())
            plugintools.log("freshstart.main_list NOT removed")
        plugintools.add_item(action="", title="Kodi Sluiten", folder=False)
    else:
        plugintools.message(AddonTitle,
                            "Er is geen schone installatie gedaan.")
        plugintools.add_item(action="", title="Klaar", folder=False)
コード例 #10
0
ファイル: default.py プロジェクト: mustyputt/supabox
def main_list(params):
    plugintools.log("clean.main_list "+repr(params))

    yes_pressed = plugintools.message_yes_no("Supabox Fresh clean", "Do you wish to restore your", "Supabox configuration to default settings?")

    if yes_pressed:
        addonPath = xbmcaddon.Addon(id = 'plugin.video.supaboxclean').getAddonInfo('path')
        addonPath = xbmc.translatePath( addonPath )
        xbmcPath = os.path.join(addonPath,"..","..","userdata","Thumbnails")
        xbmcPath = os.path.abspath(xbmcPath)
        
        addonPath1 = xbmcaddon.Addon(id = 'plugin.video.supaboxclean').getAddonInfo('path')
        addonPath1 = xbmc.translatePath( addonPath1 )
        xbmcPath1 = os.path.join(addonPath1,"..","..","addons","packages")
        xbmcPath1 = os.path.abspath(xbmcPath1)

        plugintools.log("clean.main_list xbmcPath="+xbmcPath)
        failed=False
        
        try:
            row=texturecache.main("Xd")
            row=texturecache.main("P")
        finally:
            plugintools.log("texturecache failed ")
            pass

        plugintools.log("Error removing: "+xbmcPath1)
        try:
            for root, dirs, files in os.walk(xbmcPath1, topdown=False):
                for name in files:
                    try:
                        os.remove(os.path.join(root, name))
                    except:
                        failed=True
                        plugintools.log("Error removing "+root+" "+name)

                for name in dirs:
                    try:
                        os.rmdir(os.path.join(root, name))
                    except:
                        plugintools.log("Error removing "+root+" "+name)

            if not failed:
                plugintools.log("clean.main_list All cache files removed, you now have more space.")
                plugintools.message("Supabox Fresh Clean", "Cleaned System!")
            else:
                plugintools.log("clean.main_list addon packages partially removed")
                plugintools.message("Supabox Fresh Clean", "Failed to clean system!")
        except:
            plugintools.log("clean.main_list NOT removed")

        plugintools.add_item( action="" , title="Done" , folder=False )
    else:
        plugintools.message("Supabox Fresh Clean", "Your settings", "has not been changed")
        plugintools.add_item( action="" , title="Done" , folder=False )
コード例 #11
0
def check_for_updates():
    plugintools.log("ruyaiptv.updater checkforupdates")

    # Descarga el fichero con la versión en la web
    try:
        plugintools.log("ruyaiptv.updater remote_version_file="+REMOTE_VERSION_FILE)
        data = plugintools.read( REMOTE_VERSION_FILE )

        versiondescargada = data.splitlines()[0]
        urldescarga = data.splitlines()[1]
        plugintools.log("ruyaiptv.updater version descargada="+versiondescargada)
        
        # Lee el fichero con la versión instalada
        plugintools.log("ruyaiptv.updater local_version_file="+LOCAL_VERSION_FILE)
        infile = open( LOCAL_VERSION_FILE )
        data = infile.read()
        infile.close();

        versionlocal = data.splitlines()[0]
        plugintools.log("ruyaiptv.updater version local="+versionlocal)

        if int(versiondescargada)>int(versionlocal):
            plugintools.log("ruyaiptv.updater update found")
            
            yes_pressed = plugintools.message_yes_no("RuYa IPTV","An update is available!","Do you want to install it now?")

            if yes_pressed:
                try:
                    plugintools.log("ruyaiptv.updater Download file...")
                    local_file_name = os.path.join( plugintools.get_data_path() , "update.zip" )
                    urllib.urlretrieve(urldescarga, local_file_name )
            
                    # Lo descomprime
                    plugintools.log("ruyaiptv.updater Unzip file...")

                    import ziptools
                    unzipper = ziptools.ziptools()
                    destpathname = xbmc.translatePath( "special://home/addons")
                    plugintools.log("ruyaiptv.updater destpathname=%s" % destpathname)
                    unzipper.extract( local_file_name , destpathname )
                    
                    # Borra el zip descargado
                    plugintools.log("ruyaiptv.updater borra fichero...")
                    os.remove(local_file_name)
                    plugintools.log("ruyaiptv.updater ...fichero borrado")

                    xbmc.executebuiltin((u'XBMC.Notification("Updated", "The add-on has been updated", 2000)'))
                    xbmc.executebuiltin( "Container.Refresh" )
                except:
                    xbmc.executebuiltin((u'XBMC.Notification("Not updated", "An error causes the update to fail", 2000)'))

    except:
        import traceback
        plugintools.log(traceback.format_exc())
コード例 #12
0
def logout(item):
	logger.info("tvalacarta.channels.configuracion logout")

	confirmation = plugintools.message_yes_no("Cerrar sesión","¿Seguro que quieres cerrar la sesion?")

	if confirmation:
		api.accounts_logout( config.get_setting("account_session") )
		config.set_setting( "account_session" , "")
		config.set_setting( "account_type_registered" , "0")
		config.set_setting( "account_anonymous_id" , "" )

		plugintools.refresh_items()

		plugintools.message("Cerrar sesión","Sesion cerrada")
	else:
		plugintools.message("Cerrar sesión","La sesion sigue abierta")
コード例 #13
0
def logout(item):
	logger.info("tvalacarta.channels.configuracion logout")

	confirmation = plugintools.message_yes_no("Cerrar sesión","¿Seguro que quieres cerrar la sesion?")

	if confirmation:
		api.accounts_logout( config.get_setting("account_session") )
		config.set_setting( "account_session" , "")
		config.set_setting( "account_type_registered" , "0")
		config.set_setting( "account_anonymous_id" , "" )

		plugintools.refresh_items()

		plugintools.message("Cerrar sesión","Sesion cerrada")
	else:
		plugintools.message("Cerrar sesión","La sesion sigue abierta")
コード例 #14
0
ファイル: default.py プロジェクト: azumimuo/family-xbmc-addon
def main_list(params):
    plugintools.log("freshstart.main_list "+repr(params))

    yes_pressed = plugintools.message_yes_no("XBMC Fresh Start", "Do you wish to restore your", "XBMC configuration to default settings?")

    if yes_pressed:
        addonPath = xbmcaddon.Addon(id = 'plugin.video.freshstart').getAddonInfo('path')
        addonPath = xbmc.translatePath( addonPath )
        xbmcPath = os.path.join(addonPath,"..","..")
        xbmcPath = os.path.abspath(xbmcPath)
        plugintools.log("freshstart.main_list xbmcPath="+xbmcPath)
        failed=False

        try:
            for root, dirs, files in os.walk(xbmcPath, topdown=False):
                for name in files:
                    try:
                        os.remove(os.path.join(root, name))
                    except:
                        if name not in ["Addons15.db","MyVideos75.db","Textures13.db","xbmc.log"]:
                            failed=True
                        plugintools.log("Error removing "+root+" "+name)

                for name in dirs:
                    try:
                        os.rmdir(os.path.join(root, name))
                    except:
                        if name not in ["Database","userdata"]:
                            failed=True
                        plugintools.log("Error removing "+root+" "+name)

            if not failed:
                plugintools.log("freshstart.main_list All user files removed, you now have a clean install")
                plugintools.message("XBMC Fresh Start", "The process is complete, you're now back to a fresh XBMC configuration!","Please reboot your system or restart XBMC in order for the changes to be applied.")
            else:
                plugintools.log("freshstart.main_list User files partially removed")
                plugintools.message("XBMC Fresh Start", "The process is finished, you're now back to a fresh XBMC configuration!","Please reboot your system or restart XBMC in order for the changes to be applied.")
        except:
            plugintools.message("XBMC Fresh Start", "Problem found","Your settings has not been changed")
            import traceback
            plugintools.log(traceback.format_exc())
            plugintools.log("freshstart.main_list NOT removed")

        plugintools.add_item( action="" , title="Done" , folder=False )
    else:
        plugintools.message("XBMC Fresh Start", "Your settings", "has not been changed")
        plugintools.add_item( action="" , title="Done" , folder=False )
コード例 #15
0
ファイル: default.py プロジェクト: grimd34th/theplayerklub
def kontrolli_uuendusi():
    req = urllib2.Request(uuenduslink)
    req.add_header("User-Agent", "Kodi plugin by MikkM")
    response = urllib2.urlopen(req)
    repoversion = response.read()
    repoversion = repoversion.partition("\n")
    iversion = repoversion[1]
    global dlink
    dlink = repoversion[2]
    response.close()
    if iversion <> version:
        update = " "
    else:
        if plugintools.message_yes_no(pnimi, "New update is available!",
                                      "Do you want to update plugin now?"):
            plugintools.log(pnimi + "Trying to update plugin...")
            try:
                destpathname = xbmc.translatePath(
                    os.path.join("special://", "home/addons/"))
                local_file_name = os.path.join(plugintools.get_runtime_path(),
                                               "update.zip")
                plugintools.log(pnimi + local_file_name)
                urllib.urlretrieve(dlink, local_file_name)
                DownloaderClass(dlink, local_file_name)
                plugintools.log(pnimi + "Extracting update...")
                import ziptools
                unzipper = ziptools.ziptools()
                plugintools.log(pnimi + destpathname)
                unzipper.extract(local_file_name, destpathname)
                os.remove(local_file_name)
                xbmc.executebuiltin((
                    u'XBMC.Notification("Updated", "The add-on has been updated", 2000)'
                ))
                xbmc.executebuiltin("Container.Refresh")
                plugintools.log(pnimi + "Update success")
            except:
                plugintools.log(pnimi + "Update failed")
                xbmc.executebuiltin((
                    u'XBMC.Notification("Not updated", "An error causes the update to fail", 2000)'
                ))
コード例 #16
0
ファイル: default.py プロジェクト: adrxbmc/adrxbmc.repository
def main_list(params): # Main menu
    plugintools.log("freshstart.main_list "+repr(params)); yes_pressed=plugintools.message_yes_no(AddonTitle,"Voce deseja restaurar o seu","Kodi para as configuracoes padrao")
    if yes_pressed:
        addonPath=xbmcaddon.Addon(id=AddonID).getAddonInfo('path'); addonPath=xbmc.translatePath(addonPath); 
        xbmcPath=os.path.join(addonPath,"..",".."); xbmcPath=os.path.abspath(xbmcPath); plugintools.log("freshstart.main_list xbmcPath="+xbmcPath); failed=False
        try:
            for root, dirs, files in os.walk(xbmcPath,topdown=False):
                for name in files:
                    try: os.remove(os.path.join(root,name))
                    except:
                        if name not in ["Addons15.db","MyVideos75.db","Textures13.db","xbmc.log"]: failed=True
                        plugintools.log("Error removing "+root+" "+name)
                for name in dirs:
                    try: os.rmdir(os.path.join(root,name))
                    except:
                        if name not in ["Database","userdata"]: failed=True
                        plugintools.log("Error removing "+root+" "+name)
            if not failed: plugintools.log("freshstart.main_list Todos os arquivos do usuario removido, agora voce tem uma instalacao limpa"); plugintools.message(AddonTitle,"Processo esta concluido, voce esta agora de volta para uma configuracao do Kodi limpa!","Por favor, reinicie o sistema ou reiniciar Kodi para que as alteracoes sejam aplicadas.")
            else: plugintools.log("freshstart.main_list Arquivos do usuario parcialmente removida"); plugintools.message(AddonTitle,"Processo esta concluido, voce esta agora de volta para uma configuracao do Kodi limpa!","Por favor, reinicie o sistema ou reiniciar Kodi para que as alteracoes sejam aplicadas.")
        except: plugintools.message(AddonTitle,"Problema encontrado","As suas definicoes nao foram alteradas"); import traceback; plugintools.log(traceback.format_exc()); plugintools.log("freshstart.main_list NOT removed")
        plugintools.add_item(action="",title="Done",folder=False)
    else: plugintools.message(AddonTitle,"As definicoes","nao foram alteradas"); plugintools.add_item(action="",title="Feito",folder=False)
コード例 #17
0
ファイル: default.py プロジェクト: Barroni1977/kobra
def FRESHSTART(params):
    plugintools.log("freshstart.main_list "+repr(params)); yes_pressed=plugintools.message_yes_no("[COLOR red][B][I]KOBRA[/I][/B][/COLOR][COLOR grey] [B]FRESH START[/B][/COLOR]","DO YOU WISH TO RESTORE YOUR KODI-SPMC CONFIGURATION TO DEFAULT SETTINGS? [COLOR red][B]WARNING [/B][/COLOR]ALL YOUR DATA WILL BE LOST AND NOT RECOVERABLE. [COLOR red][B]PROCEED?[/B][/COLOR]")
    if yes_pressed:
        addonPath=xbmcaddon.Addon(id=AddonID).getAddonInfo('path'); addonPath=xbmc.translatePath(addonPath);
        xbmcPath=os.path.join(addonPath,"..",".."); xbmcPath=os.path.abspath(xbmcPath); plugintools.log("freshstart.main_list xbmcPath="+xbmcPath); failed=False
        try:
            for root, dirs, files in os.walk(xbmcPath,topdown=True):
                dirs[:] = [d for d in dirs if d not in EXCLUDES]
                for name in files:
                    try: os.remove(os.path.join(root,name))
                    except:
                        if name not in ["Addons15.db","MyVideos75.db","Textures13.db","xbmc.log"]: failed=True
                        plugintools.log("Error removing "+root+" "+name)
                for name in dirs:
                    try: os.rmdir(os.path.join(root,name))
                    except:
                        if name not in ["Database","userdata"]: failed=True
                        plugintools.log("Error removing "+root+" "+name)
            if not failed: plugintools.log("freshstart.main_list All user files removed, you now have a clean install"); plugintools.message(AddonTitle,"The process is complete, you're now back to a fresh Kodi-SPMC configuration with Kobra Wizard!","Please reboot your system or restart Kodi-SPMC in order for the changes to be applied.")
            else: plugintools.log("freshstart.main_list User files partially removed"); plugintools.message("[COLOR grey2][B]FRESH START[/B][/COLOR]","THE PROCESS IS COMPLETE, YOU ARE NOW BACK TO A FRESH KODI-SPMC CONFIGURATION.","PLEASE REBOOT YOUR SYSTEM OR RESTART KODI-SPMC FOR THE CHANGES TO BE APPLIED.")
        except: plugintools.message(AddonTitle,"Problem found","Your settings has not been changed"); import traceback; plugintools.log(traceback.format_exc()); plugintools.log("freshstart.main_list NOT removed")
        plugintools.add_item(action="",title="Now Exit Kodi",folder=False)
    else: plugintools.message("[COLOR red][B][I]KOBRA[/I][/B][/COLOR][COLOR grey] [B]FRESH START[/B][/COLOR]","YOUR SETTINGS HAVE NOT BEEN CHANGED."); plugintools.add_item(action="",title="DONE",folder=False)
コード例 #18
0
ファイル: default.py プロジェクト: MXTV/wozbox
def FRESHSTART(params):
    plugintools.log("freshstart.main_list "+repr(params)); yes_pressed=plugintools.message_yes_no(AddonTitle,"Reset WOZBOX to default settings?","PLEASE NOTE: After reboot please re-install the Plus Pack via the WOZBOX Wizard.")
    if yes_pressed:
        addonPath=xbmcaddon.Addon(id=AddonID).getAddonInfo('path'); addonPath=xbmc.translatePath(addonPath); 
        xbmcPath=os.path.join(addonPath,"..",".."); xbmcPath=os.path.abspath(xbmcPath); plugintools.log("freshstart.main_list xbmcPath="+xbmcPath); failed=False
        try:
            for root, dirs, files in os.walk(xbmcPath,topdown=True):
                dirs[:] = [d for d in dirs if d not in EXCLUDES]
                for name in files:
                    try: os.remove(os.path.join(root,name))
                    except:
                        if name not in ["Addons15.db","MyVideos75.db","xbmc.log"]: failed=True
                        plugintools.log("Error removing "+root+" "+name)
                for name in dirs:
                    try: os.rmdir(os.path.join(root,name))
                    except:
                        if name not in ["Database","userdata"]: failed=True
                        plugintools.log("Error removing "+root+" "+name)
            if not failed: plugintools.log("freshstart.main_list All user files removed, you now have a clean install"); plugintools.message(AddonTitle,"Reset complete!","Please reboot your WOZBOX in order for the changes to be applied. On restart please re-install the WOZBOX Plus Pack via the WOZBOX Wizard.")
            else: plugintools.log("freshstart.main_list User files partially removed"); plugintools.message(AddonTitle,"Reset complete!","Please reboot your WOZBOX in order for the changes to be applied. On restart please re-install the WOZBOX Plus Pack via the WOZBOX Wizard.")
        except: plugintools.message(AddonTitle,"Problem found","Your settings has not been changed"); import traceback; plugintools.log(traceback.format_exc()); plugintools.log("freshstart.main_list NOT removed")
        plugintools.add_item(action="",title="Now Exit WOZBOX",folder=False)
    else: plugintools.message(AddonTitle,"Your WOZBOX has not been changed."); plugintools.add_item(action="",title="Done",folder=False)
コード例 #19
0
def freshstart(params):
    plugintools.log("freshstart.main_list "+repr(params)); yes_pressed=plugintools.message_yes_no(AddonTitle,"Do You Wish To Wipe Your","Curreny Kodi Configuration?")
    if yes_pressed:
        addonPath=xbmcaddon.Addon(id=AddonID).getAddonInfo('path'); addonPath=xbmc.translatePath(addonPath); 
        xbmcPath=os.path.join(addonPath,"..",".."); xbmcPath=os.path.abspath(xbmcPath); plugintools.log("freshstart.main_list xbmcPath="+xbmcPath); failed=False
        try:
            for root, dirs, files in os.walk(xbmcPath,topdown=True):
                dirs[:] = [d for d in dirs if d not in EXCLUDES]
                for name in files:
                    try: os.remove(os.path.join(root,name))
                    except:
                        if name not in ["Addons15.db","MyVideos75.db","Textures13.db","xbmc.log"]: failed=True
                        plugintools.log("Error Removing "+root+" "+name)
                for name in dirs:
                    try: os.rmdir(os.path.join(root,name))
                    except:
                        if name not in ["Database","userdata"]: failed=True
                        plugintools.log("Error Removing "+root+" "+name)
            if not failed: plugintools.log("freshstart.main_list All User Files Removed, You Now Have A Clean Install"); plugintools.message(AddonTitle,"The Process Is Complete, Kodi is now clean Project X Wizard ready to install new goodies","Please Exit And Reboot Your System In Order For The Changes To Be Applied.")
            else: plugintools.log("freshstart.main_list User files partially removed"); plugintools.message(AddonTitle,"The Process Is Complete, Kodi is now clean Project X Wizard ready to install new goodies","Please Exit And Reboot Your System In Order For The Changes To Be Applied.")
        except: plugintools.message(AddonTitle,"Problem found","Your settings has not been changed"); import traceback; plugintools.log(traceback.format_exc()); plugintools.log("freshstart.main_list NOT Removed")
        plugintools.add_item(action="",title="Now Exit And Reboot Your System",folder=False)
    else: plugintools.message(AddonTitle,"Your Settings","Have Not Been Changed"); plugintools.add_item(action="",title="Done",folder=False)
コード例 #20
0
ファイル: default.py プロジェクト: tbbuild/TB-REPOSITORY
def FRESHSTART(params):
    plugintools.log("freshstart.main_list "+repr(params)); yes_pressed=plugintools.message_yes_no(AddonTitle,"Do you wish to restore your","Kodi configuration to default settings?")
    if yes_pressed:
        addonPath=xbmcaddon.Addon(id=AddonID).getAddonInfo('path'); addonPath=xbmc.translatePath(addonPath); 
        xbmcPath=os.path.join(addonPath,"..",".."); xbmcPath=os.path.abspath(xbmcPath); plugintools.log("freshstart.main_list xbmcPath="+xbmcPath); failed=False
        try:
            for root, dirs, files in os.walk(xbmcPath,topdown=True):
                dirs[:] = [d for d in dirs if d not in EXCLUDES]
                for name in files:
                    try: os.remove(os.path.join(root,name))
                    except:
                        if name not in ["Addons15.db","MyVideos75.db","Textures13.db","xbmc.log"]: failed=True
                        plugintools.log("Error removing "+root+" "+name)
                for name in dirs:
                    try: os.rmdir(os.path.join(root,name))
                    except:
                        if name not in ["Database","userdata"]: failed=True
                        plugintools.log("Error removing "+root+" "+name)
            if not failed: plugintools.log("freshstart.main_list All user files removed, you now have a clean install"); plugintools.message(AddonTitle,"The process is complete, you're now back to a fresh Kodi configuration with TB BUILD Wizard!","Please reboot your system or restart Kodi in order for the changes to be applied.")
            else: plugintools.log("freshstart.main_list User files partially removed"); plugintools.message(AddonTitle,"The process is complete, you're now back to a fresh Kodi configuration with TB BUILD Wizard","Please reboot your system or restart Kodi in order for the changes to be applied.")
        except: plugintools.message(AddonTitle,"Problem found","Your settings has not been changed"); import traceback; plugintools.log(traceback.format_exc()); plugintools.log("freshstart.main_list NOT removed")
        plugintools.add_item(action="",title="Now Exit Kodi",folder=False)
    else: plugintools.message(AddonTitle,"Your settings","has not been changed"); plugintools.add_item(action="",title="Done",folder=False)
コード例 #21
0
ファイル: default.py プロジェクト: vufiko/DSS
def FRESHSTART(params):
    plugintools.log("freshstart.main_list "+repr(params)); yes_pressed=plugintools.message_yes_no(AddonTitle,"Wil je de standaard instellingen terug zetten van je Kodi installatie?")
    if yes_pressed:
        addonPath=xbmcaddon.Addon(id=AddonID).getAddonInfo('path'); addonPath=xbmc.translatePath(addonPath); 
        xbmcPath=os.path.join(addonPath,"..",".."); xbmcPath=os.path.abspath(xbmcPath); plugintools.log("freshstart.main_list xbmcPath="+xbmcPath); failed=False
        try:
            for root, dirs, files in os.walk(xbmcPath,topdown=True):
                dirs[:] = [d for d in dirs if d not in EXCLUDES]
                for name in files:
                    try: os.remove(os.path.join(root,name))
                    except:
                        if name not in ["Addons15.db","MyVideos75.db","Textures13.db","xbmc.log"]: failed=True
                        plugintools.log("Error removing "+root+" "+name)
                for name in dirs:
                    try: os.rmdir(os.path.join(root,name))
                    except:
                        if name not in ["Database","userdata"]: failed=True
                        plugintools.log("Error removing "+root+" "+name)
            if not failed: plugintools.log("freshstart.main_list All user files removed, you now have a clean install"); plugintools.message(AddonTitle,"Schone Installatie is klaar, je hebt nu een verse Kodi configuratie met DSS Install. Herstart nu je box!")
            else: plugintools.log("freshstart.main_list User files partially removed"); plugintools.message(AddonTitle,"Schone Installatie is klaar, je hebt nu een verse Kodi configuratie met DSS Install. Herstart nu je box!")
        except: plugintools.message(AddonTitle,"Problem found","Your settings has not been changed"); import traceback; plugintools.log(traceback.format_exc()); plugintools.log("freshstart.main_list NOT removed")
        plugintools.add_item(action="",title="Kodi Sluiten",folder=False)
    else: plugintools.message(AddonTitle,"Er is geen schone installatie gedaan."); plugintools.add_item(action="",title="Klaar",folder=False)