コード例 #1
0
def checkUpdate():
    BUILDNAME = wiz.getS('buildname')
    BUILDVERSION = wiz.getS('buildversion')
    link = wiz.openURL(BUILDFILE).replace('\n',
                                          '').replace('\r',
                                                      '').replace('\t', '')
    match = re.compile('name="%s".+?ersion="(.+?)"' % BUILDNAME).findall(link)
    if len(match) > 0:
        version = match[0]
        wiz.setS('latestversion', version)
        if version > BUILDVERSION:
            if DISABLEUPDATE == 'false':
                wiz.log(
                    "[Check Updates] [Installed Version: %s] [Current Version: %s] Opening Update Window"
                    % (BUILDVERSION, version), xbmc.LOGNOTICE)
                notify.updateWindow()
            else:
                wiz.log(
                    "[Check Updates] [Installed Version: %s] [Current Version: %s] Update Window Disabled"
                    % (BUILDVERSION, version), xbmc.LOGNOTICE)
        else:
            wiz.log(
                "[Check Updates] [Installed Version: %s] [Current Version: %s]"
                % (BUILDVERSION, version), xbmc.LOGNOTICE)
    else:
        wiz.log(
            "[Check Updates] ERROR: Unable to find build version in build text file",
            xbmc.LOGERROR)
コード例 #2
0
def checkUpdate():
    BUILDNAME = wiz.getS('buildname')
    BUILDVERSION = wiz.getS('buildversion')
    link = wiz.openURL(BUILDFILE).replace('\n',
                                          '').replace('\r',
                                                      '').replace('\t', '')
    match = re.compile(
        'name="%s".+?ersion="(.+?)".+?con="(.+?)".+?anart="(.+?)"' %
        BUILDNAME).findall(link)
    if len(match) > 0:
        version = match[0][0]
        icon = match[0][1]
        fanart = match[0][2]
        wiz.setS('latestversion', version)
        if version > BUILDVERSION:
            if DISABLEUPDATE == 'false':
                wiz.log(
                    "[Verificar atualizações] [Versão instalada: %s] [Versão atual: %s] Abrindo janela de atualização"
                    % (BUILDVERSION, version), xbmc.LOGNOTICE)
                notify.updateWindow(BUILDNAME, BUILDVERSION, version, icon,
                                    fanart)
            else:
                wiz.log(
                    "[Check Updates] [Installed Version: %s] [Current Version: %s] Update Window Disabled"
                    % (BUILDVERSION, version), xbmc.LOGNOTICE)
        else:
            wiz.log(
                "[Verificar atualizações] [Versão instalada: %s] [Versão atual: %s]"
                % (BUILDVERSION, version), xbmc.LOGNOTICE)
    else:
        wiz.log(
            "[Verificar atualizações] ERRO: Não é possível encontrar a versão da build no arquivo de texto de build",
            xbmc.LOGERROR)
コード例 #3
0
def checkUpdate():
    BUILDNAME = wiz.getS('buildname')
    BUILDVERSION = wiz.getS('buildversion')
    link = wiz.openURL(BUILDFILE).replace('\n',
                                          '').replace('\r',
                                                      '').replace('\t', '')
    match = re.compile(
        'name="%s".+?ersion="(.+?)".+?con="(.+?)".+?anart="(.+?)"' %
        BUILDNAME).findall(link)
    if len(match) > 0:
        version = match[0][0]
        icon = match[0][1]
        fanart = match[0][2]
        wiz.setS('latestversion', version)
        if version > BUILDVERSION:
            if DISABLEUPDATE == 'false':
                wiz.log(
                    "[Updates] [Version: %s] [Ultima Version: %s] Buscar Update"
                    % (BUILDVERSION, version), xbmc.LOGNOTICE)
                notify.updateWindow(BUILDNAME, BUILDVERSION, version, icon,
                                    fanart)
            else:
                wiz.log(
                    "[Updates] [Version: %s] [Ultima Version: %s] Buscar Update Disabilitado"
                    % (BUILDVERSION, version), xbmc.LOGNOTICE)
        else:
            wiz.log(
                "[Updates] [Version: %s] [Ultima Version: %s]" %
                (BUILDVERSION, version), xbmc.LOGNOTICE)
    else:
        wiz.log("[Updates] ERROR: Archivo TXT no disponible", xbmc.LOGERROR)
コード例 #4
0
def checkUpdate():
    BUILDNAME = wiz.getS('buildname')
    BUILDVERSION = wiz.getS('buildversion')
    link = wiz.openURL(BUILDFILE).replace('\n',
                                          '').replace('\r',
                                                      '').replace('\t', '')
    match = re.compile(
        'name="%s".+?ersion="(.+?)".+?con="(.+?)".+?anart="(.+?)"' %
        BUILDNAME).findall(link)
    if len(match) > 0:
        version = match[0][0]
        icon = match[0][1]
        fanart = match[0][2]
        wiz.setS('latestversion', version)
        if version > BUILDVERSION:
            if DISABLEUPDATE == 'false':
                wiz.log(
                    "[Check Updates] [Installierte Version: %s] [Aktuelle Version: %s] Offne Update Fenster"
                    % (BUILDVERSION, version), xbmc.LOGNOTICE)
                notify.updateWindow(BUILDNAME, BUILDVERSION, version, icon,
                                    fanart)
            else:
                wiz.log(
                    "[Check Updates] [Installierte Version: %s] [Aktuelle Version: %s] Offne Update Fenster deaktiviert"
                    % (BUILDVERSION, version), xbmc.LOGNOTICE)
        else:
            wiz.log(
                "[Check Updates] [Installierte Version: %s] [Aktuelle Version: %s]"
                % (BUILDVERSION, version), xbmc.LOGNOTICE)
    else:
        wiz.log(
            "[Check Updates] FEHLER: Kann die Build Version nicht in der Build Text Datei finden",
            xbmc.LOGERROR)
コード例 #5
0
def checkUpdate():
    BUILDNAME = wiz.getS('buildname')
    BUILDVERSION = wiz.getS('buildversion')
    link = wiz.openURL(BUILDFILE).replace('\n',
                                          '').replace('\r',
                                                      '').replace('\t', '')
    match = re.compile(
        'name="%s".+?ersion="(.+?)".+?con="(.+?)".+?anart="(.+?)"' %
        BUILDNAME).findall(link)
コード例 #6
0
ファイル: startup.py プロジェクト: pansbox/Pandoras-Box
def checkUpdate():
	BUILDNAME      = wiz.getS('buildname')
	BUILDVERSION   = wiz.getS('buildversion')
	link           = wiz.openURL(BUILDFILE).replace('\n','').replace('\r','').replace('\t','')
	match          = re.compile('name="%s".+?ersion="(.+?)"' % BUILDNAME).findall(link)
	if len(match) > 0:
		version = match[0]
		wiz.setS('latestversion', version)
		if version > BUILDVERSION:
			notify.updateWindow()
		else: wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s]" % (BUILDVERSION, version))
	else: wiz.log("[Check Updates] ERROR: Unable to find build version in build text file")
コード例 #7
0
ファイル: default.py プロジェクト: geeteev/geeteecleaner
def getIP():
    site = 'http://whatismyipaddress.com/'
    if not wiz.workingURL(site): return 'Unknown', 'Unknown', 'Unknown'
    page = wiz.openURL(site).replace('\n', '').replace('\r', '')
    if not 'Access Denied' in page:
        ipmatch = re.compile('whatismyipaddress.com/ip/(.+?)"').findall(page)
        ipfinal = ipmatch[0] if (len(ipmatch) > 0) else 'Unknown'
        details = re.compile('"font-size:14px;">(.+?)</td>').findall(page)
        provider = details[0] if (len(details) > 0) else 'Unknown'
        location = details[1] + ', ' + details[2] + ', ' + details[3] if (
            len(details) > 2) else 'Unknown'
        return ipfinal, provider, location
    else:
        return 'Unknown', 'Unknown', 'Unknown'
コード例 #8
0
ファイル: startup.py プロジェクト: CYBERxNUKE/xbmc-addon
def checkUpdate():
	BUILDNAME      = wiz.getS('buildname')
	BUILDVERSION   = wiz.getS('buildversion')
	link           = wiz.openURL(BUILDFILE).replace('\n','').replace('\r','').replace('\t','')
	match          = re.compile('name="%s".+?ersion="(.+?)".+?con="(.+?)".+?anart="(.+?)"' % BUILDNAME).findall(link)
	if len(match) > 0:
		version = match[0][0]
		icon    = match[0][1]
		fanart  = match[0][2]
		wiz.setS('latestversion', version)
		if version > BUILDVERSION:
			if DISABLEUPDATE == 'false':
				wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s] Opening Update Window" % (BUILDVERSION, version), xbmc.LOGNOTICE)
				notify.updateWindow(BUILDNAME, BUILDVERSION, version, icon, fanart)
			else: wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s] Update Window Disabled" % (BUILDVERSION, version), xbmc.LOGNOTICE)
		else: wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s]" % (BUILDVERSION, version), xbmc.LOGNOTICE)
	else: wiz.log("[Check Updates] ERROR: Unable to find build version in build text file", xbmc.LOGERROR)
コード例 #9
0
def checkUpdate():
	BUILDNAME      = wiz.getS('buildname')
	BUILDVERSION   = wiz.getS('buildversion')
	link           = wiz.openURL(BUILDFILE).replace('\n','').replace('\r','').replace('\t','')
	match          = re.compile('name="%s".+?ersion="(.+?)".+?con="(.+?)".+?anart="(.+?)"' % BUILDNAME).findall(link)
	if len(match) > 0:
		version = match[0][0]
		icon    = match[0][1]
		fanart  = match[0][2]
		wiz.setS('latestversion', version)
		if version > BUILDVERSION:
			if DISABLEUPDATE == 'false':
				wiz.log("[Verificar Atualizacoes] [Versao Instalada: %s] [Versao Atual: %s] Abrindo a Janela de Atualizacao" % (BUILDVERSION, version), xbmc.LOGNOTICE)
				notify.updateWindow(BUILDNAME, BUILDVERSION, version, icon, fanart)
			else: wiz.log("[Verificar Atualizacoes] [Versao Instalada: %s] [Versao Atual: %s] Abrindo a Janela de Atualizacao" % (BUILDVERSION, version), xbmc.LOGNOTICE)
		else: wiz.log("[Verificar Atualizacoes] [Versao Instalada: %s] [Versao Atual: %s]" % (BUILDVERSION, version), xbmc.LOGNOTICE)
	else: wiz.log("[Verificar Atualizacoes] ERRO: Nao e possivel encontrar a versao de compilacao da BUILD no arquivo de texto", xbmc.LOGERROR)
コード例 #10
0
ファイル: startup.py プロジェクト: brokentechie/BTrepo
def checkUpdate():
	BUILDNAME      = wiz.getS('buildname')
	BUILDVERSION   = wiz.getS('buildversion')
	link           = wiz.openURL(BUILDFILE).replace('\n','').replace('\r','').replace('\t','')
	match          = re.compile('name="%s".+?ersion="(.+?)"' % BUILDNAME).findall(link)
	if len(match) > 0:
		version = match[0]
		wiz.setS('latestversion', version)
		if version > BUILDVERSION:
			yes_pressed = DIALOG.yesno(ADDONTITLE,"New version of your current build avaliable: %s v%s" % (BUILDNAME, version), "Click Go to Build Page to install update.", yeslabel="Go to Build Page", nolabel="Ignore for 3 days")
			if yes_pressed:
				wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s] [User Selected: Install build]" % (BUILDVERSION, version))
				url = 'plugin://%s/?mode=viewbuild&name=%s' % (ADDON_ID, urllib.quote_plus(BUILDNAME))
				xbmc.executebuiltin('ActivateWindow(10025 ,%s, return)' % url)
				wiz.setS('lastbuildcheck', str(NEXTCHECK))
			else: 
				wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s] [User Selected: Wait 3 days]" % (BUILDVERSION, version))
				DIALOG.ok(ADDONTITLE, 'You can still update %s to %s from the %s.' % (BUILDNAME, version, ADDONTITLE))
				wiz.setS('lastbuildcheck', str(THREEDAYS))
		else: wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s]" % (BUILDVERSION, version))
	else: wiz.log("[Check Updates] ERROR: Unable to find build version in build text file")
コード例 #11
0
        wiz.copytree(ADDONPATH, newpath)
    except Exception, e:
        pass
    wiz.forceUpdate(True)

BACKUPLOCATION = xbmc.translatePath(BACKUPLOCATION)
MYBUILDS = os.path.join(BACKUPLOCATION, 'My_Builds')
if not os.path.exists(BACKUPLOCATION): os.makedirs(BACKUPLOCATION)
if not os.path.exists(MYBUILDS): os.makedirs(MYBUILDS)

wiz.log("[Auto Install Repo] Started", xbmc.LOGNOTICE)
if AUTOINSTALL == 'Yes' and not os.path.exists(os.path.join(ADDONS, REPOID)):
    workingxml = wiz.workingURL(REPOADDONXML)
    if workingxml == True:
        link = wiz.openURL(REPOADDONXML).replace('\n',
                                                 '').replace('\r', '').replace(
                                                     '\t', '')
        match = re.compile('<addon.+?id="%s".+?ersion="(.+?)".+?>' %
                           REPOID).findall(link)
        if len(match) == 0:
            wiz.log("Invalid URL for Repo Zip", xbmc.LOGERROR)
        else:
            installzip = '%s-%s.zip' % (REPOID, match[0])
            workingrepo = wiz.workingURL(REPOZIPURL + installzip)
            if workingrepo == True:
                DP.create(ADDONTITLE, 'Downloading Repo...', '', 'Please Wait')
                if not os.path.exists(PACKAGES): os.makedirs(PACKAGES)
                lib = os.path.join(PACKAGES, installzip)
                try:
                    os.remove(lib)
                except:
コード例 #12
0
		wiz.copytree(ADDONPATH, newpath)
	except Exception, e:
		pass
	wiz.forceUpdate(True)

try:
	mybuilds = xbmc.translatePath(MYBUILDS)
	if not os.path.exists(mybuilds): xbmcvfs.mkdirs(mybuilds)
except:
	pass

wiz.log("[Auto Install Repo] Started", xbmc.LOGNOTICE)
if AUTOINSTALL == 'Yes' and not os.path.exists(os.path.join(ADDONS, REPOID)):
	workingxml = wiz.workingURL(REPOADDONXML)
	if workingxml == True:
		ver = wiz.parseDOM(wiz.openURL(REPOADDONXML), 'addon', ret='version', attrs = {'id': REPOID})
		if len(ver) > 0:
			installzip = '%s-%s.zip' % (REPOID, ver[0])
			workingrepo = wiz.workingURL(REPOZIPURL+installzip)
			if workingrepo == True:
				DP.create(ADDONTITLE,'Downloading Repo...','', 'Please Wait')
				if not os.path.exists(PACKAGES): os.makedirs(PACKAGES)
				lib=os.path.join(PACKAGES, installzip)
				try: os.remove(lib)
				except: pass
				downloader.download(REPOZIPURL+installzip,lib, DP)
				extract.all(lib, ADDONS, DP)
				try:
					f = open(os.path.join(ADDONS, REPOID, 'addon.xml'), mode='r'); g = f.read(); f.close()
					name = wiz.parseDOM(g, 'addon', ret='name', attrs = {'id': REPOID})
					wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name[0]), "[COLOR %s]Add-on updated[/COLOR]" % COLOR2, icon=os.path.join(ADDONS, REPOID, 'icon.png'))
コード例 #13
0
ファイル: startup.py プロジェクト: KWIZARDK/miwizard
if not os.path.exists(ADVANCED): writeAdvanced()

try:
    mybuilds = xbmc.translatePath(MYBUILDS)
    if not os.path.exists(mybuilds): xbmcvfs.mkdirs(mybuilds)
except:
    pass

wiz.log("Flushing Aged Cached Text Files")
wiz.flushOldCache()

wiz.log("[Auto Install Repo] Started", xbmc.LOGNOTICE)
if AUTOINSTALL == 'Yes' and not os.path.exists(os.path.join(ADDONS, REPOID)):
    workingxml = wiz.workingURL(REPOADDONXML)
    if workingxml == True:
        ver = wiz.parseDOM(wiz.openURL(REPOADDONXML),
                           'addon',
                           ret='version',
                           attrs={'id': REPOID})
        if len(ver) > 0:
            installzip = '%s-%s.zip' % (REPOID, ver[0])
            workingrepo = wiz.workingURL(REPOZIPURL + installzip)
            if workingrepo == True:
                DP.create(ADDONTITLE, 'Downloading Repo...', '', 'Please Wait')
                if not os.path.exists(PACKAGES): os.makedirs(PACKAGES)
                lib = os.path.join(PACKAGES, installzip)
                try:
                    os.remove(lib)
                except:
                    pass
                downloader.download(REPOZIPURL + installzip, lib, DP)
コード例 #14
0
ファイル: startup.py プロジェクト: brokentechie/BTrepo
id   = xbmcaddon.Addon().getAddonInfo('id')
path = xbmcaddon.Addon().getAddonInfo('path').replace(ADDONS,'')[1:]
if not id == path: DIALOG.ok(ADDONTITLE, 'Please make sure that the plugin folder is the', 'Same as the ADDON_ID.')

if AUTOCLEANUP == 'true':
	if AUTOCACHE == 'true': wiz.log('[AUTO CLEAN UP][Cache: on]'); wiz.clearCache()
	else: wiz.log('[AUTO CLEAN UP][Cache: off]')
	if AUTOPACKAGES == 'true': wiz.log('[AUTO CLEAN UP][Packages: on]'); wiz.clearPackages('startup')
	else: wiz.log('[AUTO CLEAN UP][Packages: off]')
else: wiz.log('[AUTO CLEAN UP: off]')

if AUTOINSTALL == 'Yes' and not os.path.exists(os.path.join(ADDONS, REPOID)):
	workingxml = wiz.workingURL(REPOADDONXML)
	if workingxml == True:
		link    = wiz.openURL(REPOADDONXML).replace('\n','').replace('\r','').replace('\t','')
		match   = re.compile('<addon.+?id="%s".+?ersion="(.+?)".+?>' % REPOID).findall(link)
		installzip = '%s-%s.zip' % (REPOID, match[0])
		workingrepo = wiz.workingURL(REPOZIPURL+installzip)
		if workingrepo == True:
			if not os.path.exists(PACKAGES): os.makedirs(PACKAGES)
			lib=os.path.join(PACKAGES, installzip)
			try: os.remove(lib)
			except: pass
			downloader.download(REPOZIPURL+installzip,lib)
			extract.all(lib, ADDONS)
			f = open(os.path.join(ADDONS, REPOID, 'addon.xml'), mode='r').read()
			match = re.compile('<addon.+?id="%s".+?ame="(.+?)".+?>' % REPOID).findall(f)
			wiz.LogNotify(match[0], "Add-on updated", icon=os.path.join(ADDONS, REPOID, 'icon.png'))
			xbmc.sleep(1000)
			xbmc.executebuiltin('UpdateAddonRepos()')
コード例 #15
0
        wiz.copytree(ADDONPATH, newpath)
    except Exception, e:
        pass
    wiz.forceUpdate(True)

try:
    mybuilds = xbmc.translatePath(MYBUILDS)
    if not os.path.exists(mybuilds): xbmcvfs.mkdirs(mybuilds)
except:
    pass

wiz.log("[Auto Install Repo] Started", xbmc.LOGNOTICE)
if AUTOINSTALL == 'Yes' and not os.path.exists(os.path.join(ADDONS, REPOID)):
    workingxml = wiz.workingURL(REPOADDONXML)
    if workingxml == True:
        ver = wiz.parseDOM(wiz.openURL(REPOADDONXML),
                           'addon',
                           ret='version',
                           attrs={'id': REPOID})
        if len(ver) > 0:
            installzip = '%s-%s.zip' % (REPOID, ver[0])
            workingrepo = wiz.workingURL(REPOZIPURL + installzip)
            if workingrepo == True:
                DP.create(ADDONTITLE, 'Downloading Repo...', '', 'Please Wait')
                if not os.path.exists(PACKAGES): os.makedirs(PACKAGES)
                lib = os.path.join(PACKAGES, installzip)
                try:
                    os.remove(lib)
                except:
                    pass
                downloader.download(REPOZIPURL + installzip, lib, DP)
コード例 #16
0
ファイル: startup.py プロジェクト: Shepo6/Shepo
if not os.path.exists(ADVANCED): writeAdvanced()

try:
	mybuilds = xbmc.translatePath(MYBUILDS)
	if not os.path.exists(mybuilds): xbmcvfs.mkdirs(mybuilds)
except:
	pass

wiz.log("Flushing Aged Cached Text Files")
wiz.flushOldCache()

wiz.log("[Auto Install Repo] Started", xbmc.LOGNOTICE)
if AUTOINSTALL == 'Yes' and not os.path.exists(os.path.join(ADDONS, REPOID)):
	workingxml = wiz.workingURL(REPOADDONXML)
	if workingxml == True:
		ver = wiz.parseDOM(wiz.openURL(REPOADDONXML), 'addon', ret='version', attrs = {'id': REPOID})
		if len(ver) > 0:
			installzip = '%s-%s.zip' % (REPOID, ver[0])
			workingrepo = wiz.workingURL(REPOZIPURL+installzip)
			if workingrepo == True:
				DP.create(ADDONTITLE,'Downloading Repo...','', 'Please Wait')
				if not os.path.exists(PACKAGES): os.makedirs(PACKAGES)
				lib=os.path.join(PACKAGES, installzip)
				try: os.remove(lib)
				except: pass
				downloader.download(REPOZIPURL+installzip,lib, DP)
				extract.all(lib, ADDONS, DP)
				try:
					f = open(os.path.join(ADDONS, REPOID, 'addon.xml'), mode='r'); g = f.read(); f.close()
					name = wiz.parseDOM(g, 'addon', ret='name', attrs = {'id': REPOID})
					wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name[0]), "[COLOR %s]Add-on updated[/COLOR]" % COLOR2, icon=os.path.join(ADDONS, REPOID, 'icon.png'))