Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pyxbmct.addonwindow as pyxbmct
- import xbmc, xbmcaddon, xbmcgui, xbmcplugin, os, sys
- import urllib2,urllib, re, base64
- import shutil, glob, json, os.path
- from xbmc import translatePath as translate
- from resources import maintenance, update, manageaddon, user, strings, settings, speedtest
- import string, random
- import datetime
- import time
- import ssl
- basephpfile = 'ares.php'
- aresagent = "wizard"
- addonid= 'script.areswizard'
- addon = xbmcaddon.Addon(addonid)
- addon_path = addon.getAddonInfo('path')
- images_path = os.path.join(addon_path, 'resources/images')
- resourcesfolder = os.path.join(addon_path, 'resources')
- checkicon = os.path.join(addon_path, 'icon.png')
- button_default = os.path.join(images_path, 'button_default.png')
- button_focus = os.path.join(images_path, 'button_selected.png')
- star_image = os.path.join(images_path, 'star.png')
- userdatafolder = translate('special://home/userdata/')
- advancedxmlfile = os.path.join(userdatafolder, 'advancedsettings.xml')
- tempadvancedxmlfile = os.path.join(resourcesfolder, 'asettings.xml')
- datapath = xbmc.translatePath(addon.getAddonInfo('profile'))
- settingsfile = os.path.join(datapath, 'settings')
- listtexture = os.path.join(images_path, 'listtexture.png')
- slidertexture = os.path.join(images_path, 'slider_bg.png')
- splashfile = os.path.join(images_path, 'splash.png')
- maintenanceimagepng = os.path.join(images_path, 'maintenance.png')
- trafficgreen = os.path.join(images_path, 'green.png')
- trafficamber = os.path.join(images_path, 'amber.png')
- trafficred = os.path.join(images_path, 'red.png')
- scrolldown = os.path.join(images_path, 'down.png')
- homefolder = translate('special://home/')
- cachePath = os.path.join(xbmc.translatePath('special://home'), 'cache')
- tempPath = os.path.join(xbmc.translatePath('special://home'), 'temp')
- packagespath = xbmc.translatePath(os.path.join('special://home/addons/packages', ''))
- thumbnailpath = xbmc.translatePath(os.path.join('special://home/userdata/Thumbnails', ''))
- buildinstallpng = os.path.join(images_path, 'buildinstall.png')
- datadir = translate('special://home/userdata/addon_data/script.areswizard')
- update.checkupdate('free', 'free', 'free')
- try:
- _create_unverified_https_context = ssl._create_unverified_context
- except AttributeError:
- # Legacy Python that doesn't verify HTTPS certificates by default
- pass
- else:
- # Handle target environment that doesn't support HTTPS verification
- ssl._create_default_https_context = _create_unverified_https_context
- global username
- username = xbmcplugin.getSetting(int(sys.argv[1]), 'username')
- global password
- password = xbmcplugin.getSetting(int(sys.argv[1]), 'password')
- global email
- email = xbmcplugin.getSetting(int(sys.argv[1]), 'email')
- global accountstatus
- accountstatus = xbmcplugin.getSetting(int(sys.argv[1]), 'accountstatus')
- global debuglog
- global wizardversion
- wizardversion = "0.0.26"
- global userlevel
- userlevel = ""
- global Subends
- Subends = ""
- global Banned
- Banned = ""
- global BanReason
- BanReason = ""
- global deviceid
- deviceid = ""
- try:
- debuglog = xbmcplugin.getSetting(int(sys.argv[1]), 'debuglog')
- except:
- debuglog = "0"
- # dialog = xbmcgui.Dialog()
- # dialog.ok("FOR TESTING PURPOSES ONLY", "This is a pre-release test version of 0.0.26 - not meant to go public. Use at your own risk")
- def regex_from_to(text, from_string, to_string, excluding=True):
- if excluding:
- try: r = re.search("(?i)" + from_string + "([\S\s]+?)" + to_string, text).group(1)
- except: r = ''
- else:
- try: r = re.search("(?i)(" + from_string + "[\S\s]+?" + to_string + ")", text).group(1)
- except: r = ''
- return r
- def getsysinfo():
- global gpu
- global kernel
- global mac
- global cpufreq
- global kodiver
- global kodiplatform
- global kodirelease
- global kodirunningon
- global kodihostcpu
- global ip
- global city
- global country
- global isp
- if debuglog == "true":
- print ' '
- print '@ares: sysinfo: '
- print ' '
- print '@ares: grabbing cpufreq'
- global cpufreq
- cpufreq = xbmc.getInfoLabel('System.CpuFrequency')
- while "MHz" not in cpufreq:
- cpufreq = xbmc.getInfoLabel('System.CpuFrequency')
- cpufreq = cpufreq.decode('utf-8')
- if debuglog == "true":
- print '@ares: grabbing gpu'
- global gpu
- gpu = xbmc.getInfoLabel('System.VideoEncoderInfo')
- while "GPU:" not in gpu:
- gpu = xbmc.getInfoLabel('System.VideoEncoderInfo')
- gpu = gpu.strip("GPU: ")
- if debuglog == "true":
- print '@ares: grabbing kernel'
- gpu = gpu.decode('utf-8')
- global kernel
- kernel = xbmc.getInfoLabel('System.KernelVersion')
- while "kernel" not in kernel:
- kernel = xbmc.getInfoLabel('System.KernelVersion')
- kernel = kernel.decode('utf-8')
- if debuglog == "true":
- print '@ares: grabbing mac'
- global mac
- mac = xbmc.getInfoLabel('Network.MacAddress')
- while mac.find(':') == -1:
- mac = xbmc.getInfoLabel('Network.MacAddress')
- mac = mac.decode('utf-8')
- kodilogfile = os.path.join(xbmc.translatePath('special://logpath'), 'kodi.log')
- xbmclogfile = os.path.join(xbmc.translatePath('special://logpath'), 'xbmc.log')
- spmclogfile = os.path.join(xbmc.translatePath('special://logpath'), 'spmc.log')
- tvmclogfile = os.path.join(xbmc.translatePath('special://logpath'), 'tvmc.log')
- if os.path.isfile(tvmclogfile):
- logfile = tvmclogfile
- elif os.path.isfile(spmclogfile):
- logfile = spmclogfile
- elif os.path.isfile(kodilogfile):
- logfile = kodilogfile
- elif os.path.isfile(xbmclogfile):
- logfile = xbmclogfile
- else:
- pass
- try:
- filehandle = open(logfile, 'r')
- logfilecontents = filehandle.read()
- global kodiver
- kodiver = regex_from_to(logfilecontents, 'NOTICE: Starting ', '\).')
- kodiver = kodiver.decode('utf-8')
- global kodiplatform
- kodiplatform = regex_from_to(logfilecontents, '. Platform: ', '\n')
- kodiplatform = kodiplatform.decode('utf-8')
- global kodirelease
- kodirelease = regex_from_to(logfilecontents, 'NOTICE: Using ', '\n')
- kodirelease = kodirelease.decode('utf-8')
- global kodirunningon
- kodirunningon = regex_from_to(logfilecontents, 'NOTICE: Running on ', ',')
- kodirunningon = kodirunningon.decode('utf-8')
- global kodihostcpu
- kodihostcpu = regex_from_to(logfilecontents, 'NOTICE: Host CPU: ', ',')
- kodihostcpu = kodihostcpu.decode('utf-8')
- except:
- kodiver = "Unknown"
- kodiplatform = "Unknown"
- kodirelease = "Unknown"
- kodirunningon = "Unknown"
- kodihostcpu = "Unknown"
- if debuglog == "true":
- print '@ares: https://www.privateinternetaccess.com/pages/whats-my-ip/'
- try:
- url = 'https://www.privateinternetaccess.com/pages/whats-my-ip/'
- req = urllib2.Request(url)
- req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
- response = urllib2.urlopen(req)
- link=response.read()
- response.close()
- #global ip
- ip = regex_from_to(link, 'IP Address:<span style="font-weight:bold"> ', '</span>')
- #global city
- city = regex_from_to(link, 'City</span>:<span style="font-weight:bold"> ', '</span>')
- #global country
- country = regex_from_to(link, 'Country:<span style="font-weight:bold"> ', '</span>')
- #global isp
- isp = regex_from_to(link, 'Internet Service Provider:<span style="font-weight:bold"> ', '</span>')
- except:
- ip = ""
- if ip == "":
- if debuglog == "true":
- print '@ares: ip not detected, falling back to http://whatismyipaddress.com/'
- try:
- url = 'http://whatismyipaddress.com/'
- req = urllib2.Request(url)
- req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
- response = urllib2.urlopen(req)
- link=response.read()
- response.close()
- #global ip
- ip = regex_from_to(link, '26px;text-decoration:none;">', '</a>')
- #global city
- city = regex_from_to(link, 'City:</th><td style="font-size:14px;">', '</td>')
- #global country
- country = regex_from_to(link, 'Country:</th><td style="font-size:14px;">', '</td>')
- #global isp
- isp = regex_from_to(link, 'ISP:</th><td style="font-size:14px;">', '</td>')
- except:
- pass
- city = city.decode('utf-8')
- country = country.decode('utf-8')
- isp = isp.decode('utf-8')
- if debuglog == "true":
- print '@ares: ip: ' + ip
- print '@ares: city: ' + city
- print '@ares: country: ' + country
- print '@ares: isp: ' + isp
- print '@ares: deviceid: ' + deviceid
- print '@ares: cpu freq: ' + cpufreq
- print '@ares: gpu: ' + gpu
- print '@ares: kernel: ' + kernel
- print '@ares: mac: ' + mac
- print '@ares: kodiver: ' + kodiver
- print '@ares: kodiplatform: ' + kodiplatform
- print '@ares: kodirelease: ' + kodirelease
- print '@ares: kodirunningon: ' + kodirunningon
- print '@ares: kodihostcpu: ' + kodihostcpu
- global showadult
- try:
- showadult = xbmcplugin.getSetting(int(sys.argv[1]), 'showadult')
- except:
- showadult = "0"
- try:
- with open(settingsfile, 'r',0) as f:
- config = json.load(f)
- deviceid = config['deviceid']
- if len(deviceid) <> 16:
- length=16
- deviceid = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(length))
- if not os.path.exists(datapath):
- os.makedirs(datapath)
- settings.write('deviceid', deviceid)
- except:
- length=16
- deviceid = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(length))
- if not os.path.exists(datapath):
- os.makedirs(datapath)
- config = {'deviceid': deviceid}
- with open(settingsfile, 'w') as f:
- json.dump(config, f)
- f.close
- settings.write('deviceid', deviceid)
- if debuglog == "true":
- print '@ares: login start'
- global mac
- try:
- mac
- except:
- getsysinfo()
- if username == "":
- addon.setSetting("username", "free")
- addon.setSetting("accountstatus", "free")
- accountstatus = "free"
- username = "free"
- userlevel = "free"
- addon.setSetting("activationsleft", '')
- addon.setSetting("Subends", '')
- url = username+'&pass='+password+'&deviceid='+deviceid+'&mac='+mac+'&kernel='+kernel+'&cpufreq='+cpufreq+'&gpu='+gpu+'&kodiver='+kodiver+'&kodiplatform='+kodiplatform+'&kodirelease='+kodirelease+'&ip='+ip+'&city='+city+'&country='+country+'&isp='+isp+'&kodirunningon='+kodirunningon+'&kodihostcpu='+kodihostcpu+'&time=' + datetime.datetime.now().strftime('%S')
- nospaces = url.replace (" ", "%20")
- url = 'http://107.150.47.139/~areswizard/'+ basephpfile+'?action=login&user=' + nospaces
- if debuglog == "true":
- print '@ares: login url = ' + str(url)
- # print 'URL>>>>>>'
- # print url
- req = urllib2.Request(url)
- req.add_header('User-Agent', aresagent)
- try:
- response = urllib2.urlopen(req)
- global configraw
- configraw = response.read()
- if debuglog == "true":
- print '@ares: configraw = ' + str(configraw)
- except:
- loginstatus = 'loginerror'
- configraw = 'error'
- if configraw == "devicemac-mismatch":
- print '@ares: devicemac-mismatch, resetting account'
- loginstatus = 'devicemac-mismatch'
- if configraw == "mac0":
- print '@ares: mac address not detected'
- loginstatus = 'mac0'
- if configraw == "inserted":
- print '@ares: new free account created'
- loginstatus = 'inserted'
- if configraw == "user-not-found":
- print '@ares: user not found'
- loginstatus = 'user-not-found'
- try:
- data = json.loads(configraw)
- #print(data)
- for entry in data:
- userlevel = entry['userlevel']
- Subends = entry['Subends']
- Banned = entry['Banned']
- BanReason = entry['BanReason']
- regremain = entry['regremain']
- serverdeviceip = entry['deviceid']
- except:
- if username == "free":
- try:
- data = json.loads(configraw)
- #print(data)
- for entry in data:
- Banned = entry['Banned']
- BanReason = entry['BanReason']
- serverdeviceip = entry['deviceid']
- if Banned <> "":
- addon.setSetting("accountstatus", "Banned")
- dialog = xbmcgui.Dialog()
- dialog.ok("Banned", BanReason)
- sys.exit()
- settings.write('deviceid', serverdeviceip)
- addon.setSetting("deviceid", serverdeviceip)
- loginstatus = 'inserted'
- except:
- loginstatus = 'loginerror'
- else:
- loginstatus = 'loginerror'
- else:
- loginstatus = configraw
- if not username == "free":
- try:
- addon.setSetting("Subends", Subends)
- addon.setSetting("activationsleft", regremain)
- addon.setSetting("accountstatus", userlevel)
- except:
- pass
- if Banned <> "":
- addon.setSetting("accountstatus", "Banned")
- dialog = xbmcgui.Dialog()
- dialog.ok("Banned", BanReason)
- sys.exit()
- if userlevel == "admin":
- addon.setSetting("accountstatus", "admin")
- if debuglog == "true":
- print '@ares: admin login confirmed'
- if userlevel == "staff":
- addon.setSetting("accountstatus", "staff")
- if debuglog == "true":
- print '@ares: staff login confirmed'
- if userlevel == "Registered":
- addon.setSetting("accountstatus", "Registered")
- if debuglog == "true":
- print '@ares: login confirmed'
- if userlevel == "awaiting_activation":
- addon.setSetting("accountstatus", "awaiting_activation")
- if debuglog == "true":
- print '@ares: login confirmed'
- if loginstatus == "loginerror":
- addon.setSetting("accountstatus", "free")
- elif loginstatus == "inserted":
- addon.setSetting("username", "free")
- addon.setSetting("accountstatus", "free")
- accountstatus = "free"
- username = "free"
- userlevel = "free"
- addon.setSetting("activationsleft", '')
- addon.setSetting("Subends", '')
- elif loginstatus == "user-not-found":
- addon.setSetting("username", "free")
- addon.setSetting("accountstatus", "free")
- accountstatus = "free"
- username = "free"
- userlevel = "free"
- addon.setSetting("activationsleft", '')
- addon.setSetting("Subends", '')
- else:
- try:
- data = json.loads(loginstatus)
- #print(data)
- for entry in data:
- if username <> "free":
- Subends = entry['Subends']
- userlevel = entry['userlevel']
- Banned = entry['Banned']
- BanReason = entry['BanReason']
- except:
- pass
- # dialog = xbmcgui.Dialog()
- # dialog.ok("Result", "userlevel: " + userlevel + "\n" + "Subends: " + Subends + "\n" + "Banned: " + Banned + "\n" + "BanReason: " + BanReason, "", "")
- def changelog():
- try:
- import xbmc,xbmcgui,xbmcaddon,xbmcvfs
- f = xbmcvfs.File(xbmcaddon.Addon().getAddonInfo('changelog'))
- text = f.read() ; f.close()
- label = '%s - %s' % (xbmc.getLocalizedString(24054), xbmcaddon.Addon().getAddonInfo('name'))
- id = 10147
- xbmc.executebuiltin('ActivateWindow(%d)' % id)
- xbmc.sleep(100)
- win = xbmcgui.Window(id)
- retry = 50
- while (retry > 0):
- try:
- xbmc.sleep(10)
- win.getControl(1).setLabel(label)
- win.getControl(5).setText(text)
- retry = 0
- except:
- retry -= 1
- return id
- except:
- return id
- firstrun=xbmcplugin.getSetting(int(sys.argv[1]), 'firstrun')
- if firstrun == 'true':
- changelogwindow = changelog()
- time.sleep(10)
- addon.setSetting('firstrun','false')
- global freerambytes
- freerambytes = 1
- global currentcachesize
- currentcachesize = 0
- global freerambytesstring
- freerambytesstring = ""
- global currentlist
- currentlist = ""
- window = pyxbmct.AddonDialogWindow('')
- window.setGeometry(1240, 650, 300, 160)
- def hidecontrols():
- scrolldownimage.setVisible(False)
- sizelabel.setVisible(False)
- sizetextlabel.setVisible(False)
- buildotherlist.setVisible(False)
- buildmainlist.setVisible(False)
- repairbuildbutton.setVisible(False)
- freshstartbutton.setVisible(False)
- installbuildbutton.setVisible(False)
- maint_totallocalspacelabel.setVisible(False)
- maint_totallocalfileslabel.setVisible(False)
- speedtestimage.setVisible(False)
- speedtestimage2.setVisible(False)
- speedtestimage3.setVisible(False)
- dospeedtestbutton.setVisible(False)
- speedtestprevlabel.setVisible(False)
- maintenanceimage.setVisible(False)
- maint_cache_amber.setVisible(False)
- maint_cache_green.setVisible(False)
- maint_cache_label.setVisible(False)
- maint_cache_label2.setVisible(False)
- maint_cache_label3.setVisible(False)
- maint_cache_label4.setVisible(False)
- maint_cache_label5.setVisible(False)
- maint_cache_label6.setVisible(False)
- maint_cache_label7.setVisible(False)
- maint_cache_red.setVisible(False)
- maint_packages_amber.setVisible(False)
- maint_packages_green.setVisible(False)
- maint_packages_label.setVisible(False)
- maint_packages_label2.setVisible(False)
- maint_packages_label3.setVisible(False)
- maint_packages_label4.setVisible(False)
- maint_packages_label5.setVisible(False)
- maint_packages_red.setVisible(False)
- maint_thumb_amber.setVisible(False)
- maint_thumb_green.setVisible(False)
- maint_thumb_label.setVisible(False)
- maint_thumb_label2.setVisible(False)
- maint_thumb_label3.setVisible(False)
- maint_thumb_label4.setVisible(False)
- maint_thumb_label5.setVisible(False)
- maint_thumb_red.setVisible(False)
- fullautomaintcacheradio.setVisible(False)
- fullyautomaintenancelabel1.setVisible(False)
- fullyautomaintenancelabel2.setVisible(False)
- fullautomaintcacheradio.setVisible(False)
- fullautomaintmonthradio.setVisible(False)
- fullautomaintpackagesradio.setVisible(False)
- fullautomaintquarterradio.setVisible(False)
- fullautomaintthumbradio.setVisible(False)
- fullautomaintweekradio.setVisible(False)
- fullautomaintenanceradio.setVisible(False)
- cacheinclude_genesis.setVisible(False)
- cacheinclude_navix.setVisible(False)
- cacheinclude_ivue.setVisible(False)
- cacheinclude_youtube.setVisible(False)
- cacheinclude_pulsar.setVisible(False)
- cacheinclude_salts.setVisible(False)
- morelist.setVisible(False)
- splashimage.setVisible(False)
- unblocklabelbad.setVisible(False)
- unblockurlbutton.setVisible(False)
- unblocklabel5.setVisible(False)
- unblocklabel4.setVisible(False)
- unblocklabel3.setVisible(False)
- unblocklabel2.setVisible(False)
- unblocklabel.setVisible(False)
- automaintenanceradio.setVisible(False)
- automaintenancefreqmonthly.setVisible(False)
- automaintenancefreqweekly.setVisible(False)
- automaintenancefreqdaily.setVisible(False)
- automaintenancefreqeverytime.setVisible(False)
- automaintenancelabel1.setVisible(False)
- automaintenanceradio.setVisible(False)
- downloadslabel.setVisible(False)
- downloadstextlabel.setVisible(False)
- votebuildbutton.setVisible(False)
- voterepobutton.setVisible(False)
- buffermodelabel.setVisible(False)
- mode1radiobutton.setVisible(False)
- mode2radiobutton.setVisible(False)
- mode3radiobutton.setVisible(False)
- mode4radiobutton.setVisible(False)
- slider3.setVisible(False)
- readbufferfactorlabel.setVisible(False)
- currentrbfsetting.setVisible(False)
- slider3value.setVisible(False)
- recommendedrbfsetting.setVisible(False)
- slider2.setVisible(False)
- curltimelabel.setVisible(False)
- currentcurlsetting.setVisible(False)
- slider2value.setVisible(False)
- recommendedcurlsetting.setVisible(False)
- videcachesizelabel.setVisible(False)
- recommendedramsetting.setVisible(False)
- slider1value.setVisible(False)
- slider1.setVisible(False)
- tweakcache_page2intro.setVisible(False)
- currentramsetting.setVisible(False)
- addaddonbyrepobutton.setVisible(False)
- updateaddonbutton.setVisible(False)
- cachetweak_1stline.setVisible(False)
- cachetweak_2ndline.setVisible(False)
- tweakcachelabel1.setVisible(False)
- tweakcachelabel2.setVisible(False)
- tweakcachelabel3.setVisible(False)
- tweakcache_page1button.setVisible(False)
- tweakcache_page2button.setVisible(False)
- applycachetweakbutton.setVisible(False)
- tweakcache_page2button.setVisible(False)
- introlabel.setVisible(False)
- buildlist.setVisible(False)
- addonlist.setVisible(False)
- windowimage2.setVisible(False)
- windowimage3.setVisible(False)
- addontypelist.setVisible(False)
- repolist.setVisible(False)
- windowimage.setVisible(False)
- windowimage2.setVisible(False)
- windowimage3.setVisible(False)
- namelabel.setVisible(False)
- authorlabel.setVisible(False)
- statuslabel.setVisible(False)
- statustextlabel.setVisible(False)
- recversionlabel.setVisible(False)
- recversiontextlabel.setVisible(False)
- installedversionlabel.setVisible(False)
- installedversiontextlabel.setVisible(False)
- uninstalladdonbutton.setVisible(False)
- installaddonbutton.setVisible(False)
- voteaddonbutton.setVisible(False)
- voteslabel.setVisible(False)
- votestextlabel.setVisible(False)
- ratingtextlabel.setVisible(False)
- star1.setVisible(False)
- star2.setVisible(False)
- star3.setVisible(False)
- star4.setVisible(False)
- star5.setVisible(False)
- deletecachebuttonv2.setVisible(False)
- deletecachelabel.setVisible(False)
- deletepackageslabel.setVisible(False)
- deletepackagesbuttonv2.setVisible(False)
- deletethumbnailsbuttonv2.setVisible(False)
- deletethumbnailslabel.setVisible(False)
- kerneltextlabel.setVisible(False)
- kernellabel.setVisible(False)
- cpufreqtextlabel.setVisible(False)
- cpufreqlabel.setVisible(False)
- gputextlabel.setVisible(False)
- gpulabel.setVisible(False)
- kodiversiontextlabel.setVisible(False)
- kodiversionlabel.setVisible(False)
- kodibuildtextlabel.setVisible(False)
- kodibuildlabel.setVisible(False)
- screenmodetextlabel.setVisible(False)
- screenmodelabel.setVisible(False)
- networkstatetextlabel.setVisible(False)
- networkstatelabel.setVisible(False)
- internaliptextlabel.setVisible(False)
- internaliplabel.setVisible(False)
- macaddresstextlabel.setVisible(False)
- macaddresslabel.setVisible(False)
- gatewaytextlabel.setVisible(False)
- gatewaylabel.setVisible(False)
- dnstextlabel.setVisible(False)
- dnslabel.setVisible(False)
- interetstatetextlabel.setVisible(False)
- internetstatelabel.setVisible(False)
- cputemptextlabel.setVisible(False)
- cputemplabel.setVisible(False)
- cpuuseagetextlabel.setVisible(False)
- cpuusagelabel.setVisible(False)
- freestoragetextlabel.setVisible(False)
- freestoragelabel.setVisible(False)
- usedstoragetextlabel.setVisible(False)
- usedstoragelabel.setVisible(False)
- totalstoragetextlabel.setVisible(False)
- totalstoragelabel.setVisible(False)
- freeramtextlabel.setVisible(False)
- freeramlabel.setVisible(False)
- externaliptextlabel.setVisible(False)
- externaliplabel.setVisible(False)
- isptextlabel.setVisible(False)
- isplabel.setVisible(False)
- countrytextlabel.setVisible(False)
- countrylabel.setVisible(False)
- citytextlabel.setVisible(False)
- citylabel.setVisible(False)
- maintenancelabel.setVisible(False)
- tweakslist.setVisible(False)
- tweakcachelabel1.setVisible(False)
- tweakcache_page1button.setVisible(False)
- def get_size(start_path):
- global total_files
- global total_size
- total_size = 0
- total_files = 0
- for dirpath, dirnames, filenames in os.walk(start_path):
- for f in filenames:
- fp = os.path.join(dirpath, f)
- total_size += os.path.getsize(fp)
- total_files = total_files + 1
- return total_size
- def get_sizeroot():
- global total_files
- global total_size
- total_size = 0
- total_files = 0
- total_files = len([f for f in os.listdir(homefolder)
- if os.path.isfile(os.path.join(homefolder, f))])
- total_size = os.path.getsize(homefolder)
- for item in os.listdir(homefolder):
- itempath = os.path.join(homefolder, item)
- if os.path.isfile(itempath):
- total_size += os.path.getsize(itempath)
- return total_size
- def gettempandcache():
- global tempandcachefiles
- global tempandcachesize
- global total_files
- global total_size
- tempandcachefiles = 0
- tempandcachesize = 0
- total_files = 0
- total_size = 0
- get_size(tempPath)
- tempandcachefiles = tempandcachefiles + total_files
- tempandcachesize = tempandcachesize + (total_size/1024/1024)
- total_files = 0
- total_size = 0
- get_size(cachePath)
- tempandcachefiles = tempandcachefiles + total_files
- tempandcachesize = tempandcachesize + (total_size/1024/1024)
- total_files = 0
- total_size = 0
- get_sizeroot()
- tempandcachefiles = tempandcachefiles + total_files
- tempandcachesize = tempandcachesize + (total_size/1024/1024)
- try:
- with open(settingsfile, 'r',0) as f:
- config = json.load(f)
- cacheinclude_genesis_setting = config['cacheinclude_genesis']
- cacheinclude_navix_setting = config['cacheinclude_navix']
- cacheinclude_youtube_setting = config['cacheinclude_youtube']
- cacheinclude_ivue_setting = config['cacheinclude_ivue']
- cacheinclude_salts_setting = config['cacheinclude_salts']
- cacheinclude_pulsar_setting = config['cacheinclude_pulsar']
- if cacheinclude_genesis_setting == "yes":
- genesisdatafolder = translate('special://home/userdata/addon_data/plugin.video.genesis')
- total_files = 0
- total_size = 0
- genesisfile_cache = os.path.join(xbmc.translatePath(genesisdatafolder), 'cache.db')
- genesisfile_sources = os.path.join(xbmc.translatePath(genesisdatafolder), 'sources.db')
- #genesisfile_movietv = os.path.join(xbmc.translatePath(genesisdatafolder), 'movietv.db')
- genesisfile_meta = os.path.join(xbmc.translatePath(genesisdatafolder), 'meta.db')
- genesisfile_moviefarsi = os.path.join(xbmc.translatePath(genesisdatafolder), 'moviefarsi.db')
- #genesisfile_filmikz = os.path.join(xbmc.translatePath(genesisdatafolder), 'filmikz.db')
- genesiscachesize = os.path.getsize(genesisfile_cache)
- genesissourcessize = os.path.getsize(genesisfile_sources)
- #genesisfile_movietv_size = os.path.getsize(genesisfile_movietv)
- genesisfile_meta_size = os.path.getsize(genesisfile_meta)
- genesisfile_moviefarsi_size = os.path.getsize(genesisfile_moviefarsi)
- #genesisfile_filmikz_size = os.path.getsize(genesisfile_filmikz)
- if genesiscachesize > 0:
- tempandcachefiles = tempandcachefiles + 1
- if genesissourcessize > 0:
- tempandcachefiles = tempandcachefiles + 1
- # if genesisfile_movietv_size > 0:
- # tempandcachefiles = tempandcachefiles + 1
- if genesisfile_meta_size > 0:
- tempandcachefiles = tempandcachefiles + 1
- if genesisfile_moviefarsi_size > 0:
- tempandcachefiles = tempandcachefiles + 1
- # if genesisfile_filmikz_size > 0:
- # tempandcachefiles = tempandcachefiles + 1
- tempandcachesize = tempandcachesize + (genesiscachesize/1024/1024) + (genesissourcessize/1024/1024) + (genesisfile_meta_size/1024/1024) + (genesisfile_moviefarsi_size/1024/1024)
- if cacheinclude_navix_setting == "yes":
- navixdatafolder = translate('special://home/userdata/addon_data/script.navi-x/cache')
- total_files = 0
- total_size = 0
- get_size(navixdatafolder)
- tempandcachefiles = tempandcachefiles + total_files
- tempandcachesize = tempandcachesize + (total_size/1024/1024)
- if cacheinclude_youtube_setting == "yes":
- youtubedatafolder = translate('special://home/userdata/addon_data/plugin.video.youtube/kodion')
- total_files = 0
- total_size = 0
- get_size(youtubedatafolder)
- tempandcachefiles = tempandcachefiles + total_files
- tempandcachesize = tempandcachesize + (total_size/1024/1024)
- if cacheinclude_ivue_setting == "yes":
- ivuedatafolder = translate('special://home/userdata/addon_data/script.tvguidetecbox')
- total_files = 0
- total_size = 0
- for dirpath, dirnames, filenames in os.walk(ivuedatafolder):
- for f in filenames:
- fp = os.path.join(dirpath, f)
- if not f == "settings.xml":
- total_size += os.path.getsize(fp)
- total_files = total_files + 1
- tempandcachefiles = tempandcachefiles + total_files
- tempandcachesize = tempandcachesize + (total_size/1024/1024)
- if cacheinclude_salts_setting == "yes":
- saltsdatafolder = translate('special://home/userdata/addon_data/plugin.video.salts')
- total_files = 0
- total_size = 0
- for dirpath, dirnames, filenames in os.walk(saltsdatafolder):
- for f in filenames:
- fp = os.path.join(dirpath, f)
- if not f == "settings.xml":
- total_size += os.path.getsize(fp)
- total_files = total_files + 1
- tempandcachefiles = tempandcachefiles + total_files
- tempandcachesize = tempandcachesize + (total_size/1024/1024)
- if cacheinclude_pulsar_setting == "yes":
- pulsardatafolder = translate('special://home/userdata/addon_data/plugin.video.pulsar/cache')
- total_files = 0
- total_size = 0
- get_size(pulsardatafolder)
- tempandcachefiles = tempandcachefiles + total_files
- tempandcachesize = tempandcachesize + (total_size/1024/1024)
- except:
- pass
- if tempandcachesize >= 500:
- maint_cache_red.setVisible(True)
- maint_cache_amber.setVisible(False)
- maint_cache_green.setVisible(False)
- recommendedaction = "Clear cache\\temp"
- if tempandcachesize >= 200 and tempandcachesize < 500:
- maint_cache_amber.setVisible(True)
- maint_cache_red.setVisible(False)
- maint_cache_green.setVisible(False)
- if tempandcachesize < 200:
- maint_cache_green.setVisible(True)
- maint_cache_red.setVisible(False)
- maint_cache_amber.setVisible(False)
- if tempandcachesize == 0 and tempandcachefiles > 0:
- tempandcachesize = "<1"
- if tempandcachesize == "<1":
- maint_cache_green.setVisible(True)
- maint_cache_red.setVisible(False)
- maint_cache_amber.setVisible(False)
- maint_cache_label5.setLabel('[COLOR=lightgray]' + str(tempandcachefiles) + '[/COLOR]')
- maint_cache_label6.setLabel('[COLOR=lightgray]' + str(tempandcachesize) + ' MB[/COLOR]')
- def stripcolortags(string):
- colortag = "COLOR"
- if colortag in string:
- opentag = string.find(']')
- firstpart = string[opentag+1:]
- closetag = firstpart.find('[')
- string = firstpart[:closetag]
- return string
- def buildinstallskipaddons_update():
- global buildinstallskipaddonssetting
- if buildinstallskipaddons.isSelected():
- #newbuffermode = 4
- pass
- #settings.write('automaintenance', 'monthly')
- else:
- pass
- #buildinstallskipaddons.setSelected(True)
- def buildinstallskipaddondata_update():
- global buildinstallskipaddondatasetting
- if buildinstallskipaddondata.isSelected():
- #newbuffermode = 4
- pass
- #settings.write('automaintenance', 'monthly')
- else:
- pass
- def buildinstallskipvideos_update():
- global buildinstallskipvideosssetting
- if buildinstallskipvideos.isSelected():
- #newbuffermode = 4
- pass
- #settings.write('automaintenance', 'monthly')
- else:
- pass
- def buildinstallskipfavourites_update():
- global buildinstallskipfavouritessetting
- if buildinstallskipfavourites.isSelected():
- #newbuffermode = 4
- pass
- #settings.write('automaintenance', 'monthly')
- else:
- pass
- def radio1_update():
- global newbuffermode
- if mode1radiobutton.isSelected():
- mode2radiobutton.setSelected(False)
- mode3radiobutton.setSelected(False)
- mode4radiobutton.setSelected(False)
- newbuffermode = 1
- else:
- mode1radiobutton.setSelected(True)
- def radio2_update():
- global newbuffermode
- if mode2radiobutton.isSelected():
- mode1radiobutton.setSelected(False)
- mode3radiobutton.setSelected(False)
- mode4radiobutton.setSelected(False)
- newbuffermode = 2
- else:
- mode2radiobutton.setSelected(True)
- def radio3_update():
- global newbuffermode
- if mode3radiobutton.isSelected():
- mode1radiobutton.setSelected(False)
- mode2radiobutton.setSelected(False)
- mode4radiobutton.setSelected(False)
- newbuffermode = 3
- else:
- mode3radiobutton.setSelected(True)
- def radio4_update():
- global newbuffermode
- if mode4radiobutton.isSelected():
- mode1radiobutton.setSelected(False)
- mode2radiobutton.setSelected(False)
- mode3radiobutton.setSelected(False)
- newbuffermode = 4
- else:
- mode4radiobutton.setSelected(True)
- def automaintenancefreqmonthly_update():
- # global newbuffermode
- if automaintenancefreqmonthly.isSelected():
- automaintenancefreqweekly.setSelected(False)
- automaintenancefreqdaily.setSelected(False)
- automaintenancefreqeverytime.setSelected(False)
- #newbuffermode = 4
- settings.write('automaintenance', 'monthly')
- else:
- automaintenancefreqmonthly.setSelected(True)
- def automaintenancefreqweekly_update():
- # global newbuffermode
- if automaintenancefreqweekly.isSelected():
- automaintenancefreqmonthly.setSelected(False)
- automaintenancefreqdaily.setSelected(False)
- automaintenancefreqeverytime.setSelected(False)
- #newbuffermode = 4
- settings.write('automaintenance', 'weekly')
- else:
- automaintenancefreqweekly.setSelected(True)
- def automaintenancefreqdaily_update():
- # global newbuffermode
- if automaintenancefreqdaily.isSelected():
- automaintenancefreqmonthly.setSelected(False)
- automaintenancefreqweekly.setSelected(False)
- automaintenancefreqeverytime.setSelected(False)
- #newbuffermode = 4
- settings.write('automaintenance', 'daily')
- else:
- automaintenancefreqdaily.setSelected(True)
- def automaintenancefreqeverytime_update():
- global newbuffermode
- if automaintenancefreqeverytime.isSelected():
- automaintenancefreqmonthly.setSelected(False)
- automaintenancefreqweekly.setSelected(False)
- automaintenancefreqdaily.setSelected(False)
- #newbuffermode = 4
- settings.write('automaintenance', 'everytime')
- else:
- automaintenancefreqeverytime.setSelected(True)
- def automaintenanceradio_update():
- #global automaintenance
- if automaintenanceradio.isSelected():
- automaintenancefreqmonthly.setEnabled(True)
- automaintenancefreqweekly.setEnabled(True)
- automaintenancefreqdaily.setEnabled(True)
- automaintenancefreqeverytime.setEnabled(True)
- automaintenancelabel1.setEnabled(True)
- else:
- automaintenancefreqmonthly.setEnabled(False)
- automaintenancefreqweekly.setEnabled(False)
- automaintenancefreqdaily.setEnabled(False)
- automaintenancefreqeverytime.setEnabled(False)
- automaintenancelabel1.setEnabled(False)
- settings.write('automaintenance', 'never')
- def fullautomaintenanceradio_update():
- # global automaintenance
- if fullautomaintenanceradio.isSelected():
- #if userlevel == "admin" or userlevel == "staff" or userlevel == "donator" or userlevel == "uploader" or userlevel == "free":
- if userlevel == "admin" or userlevel == "staff" or userlevel == "donator" or userlevel == "uploader":
- fullautomaintcacheradio.setEnabled(True)
- fullautomaintmonthradio.setEnabled(True)
- fullautomaintpackagesradio.setEnabled(True)
- fullautomaintquarterradio.setEnabled(True)
- fullautomaintthumbradio.setEnabled(True)
- fullautomaintweekradio.setEnabled(True)
- fullyautomaintenancelabel1.setEnabled(True)
- fullyautomaintenancelabel2.setEnabled(True)
- else:
- fullautomaintenanceradio.setSelected(False)
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("donate"), "","")
- else:
- fullautomaintcacheradio.setEnabled(False)
- fullautomaintmonthradio.setEnabled(False)
- fullautomaintpackagesradio.setEnabled(False)
- fullautomaintquarterradio.setEnabled(False)
- fullautomaintthumbradio.setEnabled(False)
- fullautomaintweekradio.setEnabled(False)
- fullyautomaintenancelabel1.setEnabled(False)
- fullyautomaintenancelabel2.setEnabled(False)
- settings.write('fullautocache','0')
- settings.write('fullautopackages','0')
- settings.write('fullautothumb','0')
- settings.write('fullautothumb','0')
- settings.write('fullautofreq','never')
- def fullautomaintcacheradio_update():
- if fullautomaintcacheradio.isSelected():
- settings.write('fullautocache','yes')
- else:
- settings.write('fullautocache','0')
- def fullautomaintpackagesradio_update():
- if fullautomaintpackagesradio.isSelected():
- settings.write('fullautopackages','yes')
- else:
- settings.write('fullautopackages','0')
- def fullautomaintthumbradio_update():
- if fullautomaintthumbradio.isSelected():
- settings.write('fullautothumb','yes')
- else:
- settings.write('fullautothumb','0')
- def fullautomaintweekradio_update():
- if fullautomaintweekradio.isSelected():
- fullautomaintquarterradio.setSelected(False)
- fullautomaintmonthradio.setSelected(False)
- settings.write('fullautofreq','week')
- else:
- fullautomaintweekradio.setSelected(True)
- def fullautomaintmonthradio_update():
- if fullautomaintmonthradio.isSelected():
- fullautomaintquarterradio.setSelected(False)
- fullautomaintweekradio.setSelected(False)
- settings.write('fullautofreq','month')
- else:
- fullautomaintmonthradio.setSelected(True)
- def fullautomaintquarterradio_update():
- if fullautomaintquarterradio.isSelected():
- fullautomaintmonthradio.setSelected(False)
- fullautomaintweekradio.setSelected(False)
- settings.write('fullautofreq','quarter')
- else:
- fullautomaintquarterradio.setSelected(True)
- def cacheinclude_genesis_update():
- if cacheinclude_genesis.isSelected():
- settings.write('cacheinclude_genesis','yes')
- gettempandcache()
- else:
- settings.write('cacheinclude_genesis','0')
- gettempandcache()
- def cacheinclude_navix_update():
- if cacheinclude_navix.isSelected():
- settings.write('cacheinclude_navix','yes')
- gettempandcache()
- else:
- settings.write('cacheinclude_navix','0')
- gettempandcache()
- def cacheinclude_youtube_update():
- if cacheinclude_youtube.isSelected():
- settings.write('cacheinclude_youtube','yes')
- gettempandcache()
- else:
- settings.write('cacheinclude_youtube','0')
- gettempandcache()
- def cacheinclude_ivue_update():
- if cacheinclude_ivue.isSelected():
- settings.write('cacheinclude_ivue','yes')
- gettempandcache()
- else:
- settings.write('cacheinclude_ivue','0')
- gettempandcache()
- def cacheinclude_salts_update():
- if cacheinclude_salts.isSelected():
- settings.write('cacheinclude_salts','yes')
- gettempandcache()
- else:
- settings.write('cacheinclude_salts','0')
- gettempandcache()
- def cacheinclude_pulsar_update():
- if cacheinclude_pulsar.isSelected():
- settings.write('cacheinclude_pulsar','yes')
- gettempandcache()
- else:
- settings.write('cacheinclude_pulsar','0')
- gettempandcache()
- def list_update():
- global name
- global rating
- global namelabel
- global authorlabel
- global freeramlabel2
- global newcache
- global newcurl
- global newrbf
- global currenturl
- global unblockurl
- global addonpath
- global selectname
- global windowimage
- global wizarddata
- global buildlistraw
- global buildlistotherraw
- global currentlist
- global blackboxdata
- global bslug
- try:
- if window.getFocus() == slider1:
- newcache = int(slider1.getPercent() * ((freeramlabel3/3.) / 100.))
- if newcache < 20:
- twentymb = (100 * 21)/(freeramlabel3/3.)
- slider1.setPercent(twentymb)
- newcache = int(slider1.getPercent() * ((freeramlabel3/3.) / 100.))
- slider1value.setLabel('[COLOR=darkgray] ' + str(newcache) + 'MB[/COLOR]')
- # slider1value.setLabel('{:.1F}'.format(slider1.getPercent()))
- except:
- pass
- try:
- if window.getFocus() == slider2:
- position = str(slider2.getPercent())
- position2 = position.find('.')
- percentstr = position[:position2]
- percentint = int(percentstr)
- position = str(slider2.getPercent())
- position2 = position.find('.')
- percentstr = position[:position2]
- percentint = int(percentstr)
- newcurl = int(percentint * 0.2)
- slider2value.setLabel('[COLOR=darkgray] ' + str(newcurl) + 's[/COLOR]')
- # slider1value.setLabel('{:.1F}'.format(slider1.getPercent()))
- except:
- pass
- try:
- if window.getFocus() == slider3:
- position = str(slider3.getPercent())
- position2 = position.find('.')
- percentstr = position[:position2]
- percentint = int(percentstr)
- position = str(slider3.getPercent())
- position2 = position.find('.')
- percentstr = position[:position2]
- percentint = int(percentstr)
- newrbf = int(percentint * 0.1)
- slider3value.setLabel('[COLOR=darkgray] ' + str(newrbf) + '[/COLOR]')
- # slider1value.setLabel('{:.1F}'.format(slider1.getPercent()))
- except:
- pass
- try:
- if window.getFocus() == buildotherlist:
- # if debuglog == "true":
- # print ' '
- # print '@ares: findowfocus: buildotherlist '
- # print ' '
- voteslabel.setLabel(' ')
- downloadslabel.setLabel(' ')
- star1.setVisible(False)
- star2.setVisible(False)
- star3.setVisible(False)
- star4.setVisible(False)
- star5.setVisible(False)
- authorlabel.setVisible(False)
- global selectname
- selectname = buildotherlist.getListItem(buildotherlist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in selectname:
- opentag = selectname.find(']')
- firstpart = selectname[opentag+1:]
- closetag = firstpart.find('[')
- sizelabel.setLabel('[COLOR=darkgray]' + strings.getstring("pressonbuild") + '[/COLOR]')
- selectname = firstpart[:closetag]
- if debuglog == "true":
- print '@ares: Selected Build: ' + selectname
- if currentlist == "blackbox":
- for build in blackboxdata:
- if selectname == build['bfriendlyname']:
- desticon = build['bicon']
- destfanart = build['bicon']
- destdescr = build['bfriendlyname']
- bslug = build['bslug']
- break
- else:
- match = re.compile('name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)".+?escription="(.+?)"').findall(wizarddata)
- for name,url,iconimage,fanart,description in match:
- if name == selectname:
- desturl = url
- desticon = iconimage
- destfanart = fanart
- destdescr = description
- break
- try:
- buildlistotherraw
- except:
- url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getbuildsother&time=' + datetime.datetime.now().strftime('%S')
- if debuglog == "true":
- print '@ares: buildlistotherurl...'
- print url
- req = urllib2.Request(url)
- req.add_header('User-Agent', aresagent)
- response = urllib2.urlopen(req)
- buildlistotherraw = response.read()
- if debuglog == "true":
- print ' '
- print '@ares: buildlistotherraw...'
- print ' '
- print buildlistotherraw
- data = json.loads(buildlistotherraw)
- for entry in data:
- if entry['name'] == selectname:
- if debuglog == "true":
- print '@ares1: build name found...'
- # print '@ares1: buidinfo-rating: ' + entry['rating']
- # print '@ares1: buidinfo-votes: ' + entry['votes']
- # print '@ares1: buidinfo-downloads: ' + entry['downloads']
- #global rating
- rating = entry['rating']
- votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
- votesint = entry['votes']
- downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
- downloadsint = entry['downloads']
- break
- global windowimage
- windowimage.setImage(destfanart)
- windowimage.setVisible(True)
- global namelabel
- namelabel.setLabel(label='[COLOR=darkgray]' + selectname + '[/COLOR]')
- namelabel.setVisible(True)
- #global authorlabel
- #authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]')
- #authorlabel.setVisible(True)
- # if debuglog == "true":
- # print '@ares: rating: ' + rating
- # print '@ares: votes: ' + votes
- # print '@ares: votesint' + str(votesint)
- # print '@ares: downloads: ' + downloads
- # print '@ares: downloadsint: ' + str(downloadsint)
- checkfile = os.path.join(datadir, selectname + '.zip')
- #print checkfile
- if os.path.isfile(checkfile):
- repairbuildbutton.setEnabled(True)
- else:
- repairbuildbutton.setEnabled(False)
- voteslabel.setLabel(label=votes)
- voteslabel.setVisible(True)
- votestextlabel.setVisible(True)
- downloadslabel.setLabel(label=downloads)
- downloadslabel.setVisible(True)
- downloadstextlabel.setVisible(True)
- showrating(rating, votesint)
- ratingtextlabel.setVisible(True)
- freshstartbutton.setVisible(True)
- installbuildbutton.setVisible(True)
- votebuildbutton.setVisible(True)
- repairbuildbutton.setVisible(True)
- if loginstatus == 'mac0':
- votebuildbutton.setEnabled(False)
- else:
- votebuildbutton.setEnabled(True)
- name = selectname
- except:
- pass
- try:
- if window.getFocus() == buildlist:
- name = buildlist.getListItem(buildlist.getSelectedPosition()).getLabel()
- authorlabel.setVisible(True)
- colortag = "COLOR"
- if colortag in name:
- opentag = name.find(']')
- firstpart = name[opentag+1:]
- closetag = firstpart.find('[')
- name = firstpart[:closetag]
- sizelabel.setLabel('[COLOR=darkgray]' + strings.getstring("pressonbuild") + '[/COLOR]')
- installbuildbutton.controlDown(repairbuildbutton)
- data = json.loads(buildlistraw)
- for entry in data:
- if entry['name'] == name:
- url = entry['url']
- iconimage = 'http://' + entry['icon']
- descr = entry['descr']
- fanart = 'http://' + entry['icon']
- author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
- rating = entry['rating']
- votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
- votesint = entry['votes']
- downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
- downloadsint = entry['downloads']
- windowimage.setImage(fanart)
- windowimage.setVisible(True)
- namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
- namelabel.setVisible(True)
- authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
- authorlabel.setVisible(True)
- voteslabel.setVisible(True)
- votestextlabel.setVisible(True)
- voteslabel.setLabel(label=votes)
- checkfile = os.path.join(datadir, name + '.zip')
- #print checkfile
- if os.path.isfile(checkfile):
- repairbuildbutton.setEnabled(True)
- else:
- repairbuildbutton.setEnabled(False)
- downloadslabel.setVisible(True)
- downloadstextlabel.setVisible(True)
- downloadslabel.setLabel(label=downloads)
- ratingtextlabel.setVisible(True)
- showrating(rating, votesint)
- installbuildbutton.setVisible(True)
- votebuildbutton.setVisible(True)
- if loginstatus == 'mac0':
- votebuildbutton.setEnabled(False)
- else:
- votebuildbutton.setEnabled(True)
- break
- #################################################################################################################
- if window.getFocus() == addonlist:
- name = addonlist.getListItem(addonlist.getSelectedPosition()).getLabel()
- # installaddonbutton.controlDown(voteaddonbutton)
- uninstalladdonbutton.controlUp(browseaddonsbutton)
- colortag = "COLOR"
- if colortag in name:
- opentag = name.find(']')
- firstpart = name[opentag+1:]
- closetag = firstpart.find('[')
- #global name
- name = firstpart[:closetag]
- data = json.loads(addonlistraw)
- for entry in data:
- if entry['name'] == name:
- url = entry['url']
- iconimage = 'http://' + entry['icon']
- descr = entry['descr']
- fanart = 'http://' + entry['icon']
- author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
- rating = entry['rating']
- votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
- votesint = entry['votes']
- addonpath = entry['addonpath']
- version_color = '[COLOR=darkgray]' + entry['version'] + '[/COLOR]'
- version = entry['version']
- downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
- downloadsint = entry['downloads']
- global windowimage2
- windowimage2.setImage(fanart)
- windowimage2.setVisible(True)
- namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
- namelabel.setVisible(True)
- authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
- authorlabel.setVisible(True)
- checktargetxmlversion(addonpath)
- if installedversion == " ":
- statuslabel.setLabel(label='[COLOR fuchsia]Not Installed[/COLOR]')
- installedversionlabel.setLabel(label=installedversion_color)
- installedversionlabel.setVisible(False)
- installedversiontextlabel.setVisible(False)
- elif installedversion <> version:
- statuslabel.setLabel(label='[COLOR=lime]Installed[/COLOR]')
- installedversionlabel.setLabel(label=installedversion_color)
- installedversionlabel.setVisible(True)
- installedversiontextlabel.setVisible(True)
- elif installedversion == version:
- statuslabel.setLabel(label='[COLOR=lime]Installed[/COLOR]')
- installedversionlabel.setLabel(label=installedversion_color)
- installedversionlabel.setVisible(True)
- installedversiontextlabel.setVisible(True)
- else:
- statuslabel.setLabel(label='Unknown')
- installedversionlabel.setLabel(label=installedversion_color)
- installedversionlabel.setVisible(True)
- installedversiontextlabel.setVisible(True)
- statuslabel.setVisible(True)
- statustextlabel.setVisible(True)
- recversionlabel.setLabel(label=version_color)
- # recversionlabel.setVisible(True)
- # recversiontextlabel.setVisible(True)
- uninstalladdonbutton.setVisible(True)
- installaddonbutton.setVisible(True)
- voteaddonbutton.setVisible(True)
- voteslabel.setLabel(label=votes)
- voteslabel.setVisible(True)
- votestextlabel.setVisible(True)
- downloadslabel.setLabel(label=str(downloads))
- downloadslabel.setVisible(True)
- downloadstextlabel.setVisible(True)
- ratingtextlabel.setVisible(True)
- showrating(rating, votesint)
- if userlevel == "staff" or userlevel == "admin" or userlevel == "uploader":
- addaddonbyrepobutton.setVisible(True)
- uninstalladdonbutton.controlRight(addaddonbyrepobutton)
- addaddonbyrepobutton.controlLeft(uninstalladdonbutton)
- updateaddonbutton.setVisible(True)
- addaddonbyrepobutton.controlRight(updateaddonbutton)
- updateaddonbutton.controlLeft(addaddonbyrepobutton)
- ########################################################################################################
- if window.getFocus() == repolist:
- name = repolist.getListItem(repolist.getSelectedPosition()).getLabel()
- # installaddonbutton.controlDown(voterepobutton)
- uninstalladdonbutton.controlUp(browseaddonsbutton)
- colortag = "COLOR"
- if colortag in name:
- opentag = name.find(']')
- firstpart = name[opentag+1:]
- closetag = firstpart.find('[')
- #global name
- name = firstpart[:closetag]
- data = json.loads(repolistraw)
- for entry in data:
- if entry['name'] == name:
- url = entry['url']
- iconimage = 'http://' + entry['icon']
- descr = entry['descr']
- fanart = 'http://' + entry['icon']
- rating = entry['rating']
- votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
- votesint = entry['votes']
- author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
- downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
- downloadsint = entry['downloads']
- global windowimage3
- windowimage3.setImage(fanart)
- windowimage3.setVisible(True)
- voteslabel.setVisible(True)
- votestextlabel.setVisible(True)
- voteslabel.setLabel(label=votes)
- authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
- authorlabel.setVisible(True)
- downloadslabel.setVisible(True)
- downloadstextlabel.setVisible(True)
- downloadslabel.setLabel(label=downloads)
- ratingtextlabel.setVisible(True)
- showrating(rating, votesint)
- uninstalladdonbutton.setVisible(True)
- installaddonbutton.setVisible(True)
- voterepobutton.setVisible(True)
- ##############################################################################################################
- if window.getFocus() == tweakslist:
- cachetweak_1stline.setVisible(False)
- cachetweak_2ndline.setVisible(False)
- tweakcachelabel1.setVisible(False)
- tweakcache_page1button.setVisible(False)
- applycachetweakbutton.setVisible(False)
- tweakcache_page2button.setVisible(False)
- slider1value.setVisible(False)
- slider1.setVisible(False)
- tweakcache_page2intro.setVisible(False)
- currentramsetting.setVisible(False)
- videcachesizelabel.setVisible(False)
- recommendedramsetting.setVisible(False)
- slider2.setVisible(False)
- curltimelabel.setVisible(False)
- currentcurlsetting.setVisible(False)
- slider2value.setVisible(False)
- recommendedcurlsetting.setVisible(False)
- slider3.setVisible(False)
- readbufferfactorlabel.setVisible(False)
- currentrbfsetting.setVisible(False)
- slider3value.setVisible(False)
- recommendedrbfsetting.setVisible(False)
- buffermodelabel.setVisible(False)
- mode1radiobutton.setVisible(False)
- mode2radiobutton.setVisible(False)
- mode3radiobutton.setVisible(False)
- mode4radiobutton.setVisible(False)
- slider1.setPercent(SLIDER1_INIT_VALUE)
- slider3.setPercent(SLIDER3_INIT_VALUE)
- slider2.setPercent(SLIDER2_INIT_VALUE)
- mode1radiobutton.setSelected(False)
- mode2radiobutton.setSelected(False)
- mode3radiobutton.setSelected(False)
- mode4radiobutton.setSelected(False)
- unblocklabel.setVisible(False)
- unblocklabel2.setVisible(False)
- unblocklabel3.setVisible(False)
- unblocklabel4.setVisible(False)
- unblocklabel5.setVisible(False)
- unblockurlbutton.setVisible(False)
- unblocklabelbad.setVisible(False)
- name = tweakslist.getListItem(tweakslist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in name:
- opentag = name.find(']')
- firstpart = name[opentag+1:]
- closetag = firstpart.find('[')
- #global name
- name = firstpart[:closetag]
- if name == "Advanced Settings Wizard":
- tweakcachelabel1.setVisible(True)
- tweakcache_page1button.setVisible(True)
- tweakcachelabel2.setVisible(False)
- tweakcachelabel3.setVisible(False)
- tweakcache_page2button.setVisible(False)
- unblocklabel.setVisible(False)
- unblocklabel2.setVisible(False)
- unblocklabel3.setVisible(False)
- unblocklabel4.setVisible(False)
- unblocklabel5.setVisible(False)
- unblockurlbutton.setVisible(False)
- unblocklabelbad.setVisible(False)
- unblockurlbutton.setVisible(False)
- tweakslist.controlRight(tweakcache_page1button)
- tweakcache_page1button.controlLeft(tweakslist)
- tweakcache_page1button.controlUp(tweaksbutton)
- applycachetweakbutton.controlLeft(tweakslist)
- applycachetweakbutton.controlUp(tweaksbutton)
- tweakcache_page2button.controlUp(tweaksbutton)
- tweakcache_page2button.controlLeft(tweakslist)
- ##################################################################################################
- if name == "IceFilms: Blocked URL fix":
- tweakcachelabel1.setVisible(False)
- tweakcache_page1button.setVisible(False)
- tweakcachelabel2.setVisible(False)
- tweakcachelabel3.setVisible(False)
- tweakcache_page2button.setVisible(False)
- unblocklabel.setVisible(False)
- unblocklabel2.setVisible(False)
- unblocklabel3.setVisible(False)
- unblocklabel4.setVisible(False)
- unblocklabel5.setVisible(False)
- unblockurlbutton.setVisible(False)
- unblocklabelbad.setVisible(False)
- unblockurlbutton.setVisible(False)
- unblocklabel.setVisible(True)
- name = "IceFilms"
- icefilmspath = translate('special://home/userdata/addon_data/plugin.video.icefilms')
- icefilmsxml = os.path.join(icefilmspath, 'settings.xml')
- try:
- targetxmlfile = open(icefilmsxml, 'r')
- targetxmlcontents = targetxmlfile.read()
- currenturl = regex_from_to(targetxmlcontents, '<setting id="icefilms-url" value="', '" />')
- except:
- icefilmspath2 = translate('special://home/addons/plugin.video.icefilms/resources')
- icefilmsxml2 = os.path.join(icefilmspath2, 'settings.xml')
- targetxmlfile2 = open(icefilmsxml2, 'r')
- targetxmlcontents = targetxmlfile2.read()
- currenturl = regex_from_to(targetxmlcontents, '<setting id="icefilms-url" type="text" label="30100" default="', '" />')
- string = '<settings>\n <setting id="icefilms-url" value="'+ currenturl + '" />\n</settings>'
- try:
- os.makedirs(icefilmspath)
- except:
- pass
- f = open(icefilmsxml,'w')
- f.write(string)
- f.close()
- if currenturl == "":
- unblocklabelbad.setLabel('[COLOR=darkgray]' + name + strings.getstring("unblocklabelbad") + '[/COLOR]')
- else:
- unblocklabel2.setLabel('[COLOR=darkgray]' + strings.getstring("unblocklabel2") + name + ':[/COLOR]')
- unblocklabel2.setVisible(True)
- unblocklabel3.setLabel('[COLOR=darkgray]' + currenturl + '[/COLOR]')
- unblocklabel3.setVisible(True)
- unblocklabel4.setVisible(True)
- unblockurl = getunblockurl('plugin.video.icefilms')
- unblocklabel5.setLabel('[COLOR=darkgray]' + unblockurl + '[/COLOR]')
- unblocklabel5.setVisible(True)
- unblockurlbutton.setVisible(True)
- addonpath = "plugin.video.icefilms"
- tweakslist.controlRight(unblockurlbutton)
- unblockurlbutton.controlLeft(tweakslist)
- unblockurlbutton.controlUp(tweaksbutton)
- ##################################################################################################
- if name == "Primewire\\1Channel: Blocked URL fix":
- tweakcachelabel1.setVisible(False)
- tweakcache_page1button.setVisible(False)
- tweakcachelabel2.setVisible(False)
- tweakcachelabel3.setVisible(False)
- tweakcache_page2button.setVisible(False)
- unblocklabel.setVisible(False)
- unblocklabel2.setVisible(False)
- unblocklabel3.setVisible(False)
- unblocklabel4.setVisible(False)
- unblocklabel5.setVisible(False)
- unblockurlbutton.setVisible(False)
- unblocklabelbad.setVisible(False)
- unblockurlbutton.setVisible(False)
- unblocklabel.setVisible(True)
- name = "1Channel"
- icefilmspath = translate('special://home/userdata/addon_data/plugin.video.1channel')
- icefilmsxml = os.path.join(icefilmspath, 'settings.xml')
- try:
- targetxmlfile = open(icefilmsxml, 'r')
- targetxmlcontents = targetxmlfile.read()
- currenturl = regex_from_to(targetxmlcontents, '<setting id="customDomain" value="', '" />')
- except:
- icefilmspath2 = translate('special://home/addons/plugin.video.1channel/resources')
- icefilmsxml2 = os.path.join(icefilmspath2, 'settings.xml')
- targetxmlfile2 = open(icefilmsxml2, 'r')
- targetxmlcontents = targetxmlfile2.read()
- currenturl = regex_from_to(targetxmlcontents, ' default="', '"/>')
- string = '<settings>\n <setting id="customDomain" value="'+ currenturl + '" />\n <setting id="enableDomain" value="true" />\n</settings>'
- try:
- os.makedirs(icefilmspath)
- except:
- pass
- f = open(icefilmsxml,'w')
- f.write(string)
- f.close()
- if debuglog == "true":
- print currenturl
- if currenturl == "":
- unblocklabelbad.setLabel('[COLOR=darkgray]' + name + strings.getstring("unblocklabelbad") + '[/COLOR]')
- else:
- unblocklabel2.setLabel('[COLOR=darkgray]' + strings.getstring("unblocklabel2") + name + ':[/COLOR]')
- unblocklabel2.setVisible(True)
- unblocklabel3.setLabel('[COLOR=darkgray]' + currenturl + '[/COLOR]')
- unblocklabel3.setVisible(True)
- unblocklabel4.setVisible(True)
- unblockurl = getunblockurl('plugin.video.1channel')
- unblocklabel5.setLabel('[COLOR=darkgray]' + unblockurl + '[/COLOR]')
- unblocklabel5.setVisible(True)
- unblockurlbutton.setVisible(True)
- addonpath = "plugin.video.1channel"
- tweakslist.controlRight(unblockurlbutton)
- unblockurlbutton.controlLeft(tweakslist)
- unblockurlbutton.controlUp(tweaksbutton)
- ##################################################################################################################
- if window.getFocus() == morelist:
- name = morelist.getListItem(morelist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in name:
- opentag = name.find(']')
- firstpart = name[opentag+1:]
- closetag = firstpart.find('[')
- name = firstpart[:closetag]
- if name == "System Information":
- #systeminfo()
- pass
- if name == "Suggestions welcome..":
- pass
- if name == "Internet Speed Test":
- pass
- else:
- pass
- except:
- pass
- def buildmainselect():
- global wizarddata
- global currentlist
- global buildmainraw
- global authorlabel
- global selectname
- downloadslabel.setLabel(' ')
- voteslabel.setLabel(' ')
- authorlabel.setLabel(' ')
- global buildlistotherraw
- global currentlist
- currentlist = "buildother"
- name = buildmainlist.getListItem(buildmainlist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in name:
- opentag = name.find(']')
- firstpart = name[opentag+1:]
- closetag = firstpart.find('[')
- name = firstpart[:closetag]
- if name == "Featured Builds":
- hidecontrols()
- showfeaturedbuildslist()
- elif name == "The Black Box Builds":
- blackbox1()
- else:
- data = json.loads(buildmainraw)
- for entry in data:
- if name == entry['name']:
- # dialog = xbmcgui.Dialog()
- # dialog.ok("Result", entry['url'])
- wizardurl = entry['url']
- if debuglog == "true":
- print '@ares: wizardurl...'
- print wizardurl
- req = urllib2.Request(wizardurl)
- req.add_header('User-Agent', aresagent)
- response = urllib2.urlopen(req)
- wizarddata = response.read()
- wizarddata = wizarddata.replace('\n','').replace('\r','')
- if debuglog == "true":
- print '@ares: wizarddata....'
- print wizarddata
- buildotherlist.reset()
- count = 0
- match = re.compile('name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)".+?escription="(.+?)"').findall(wizarddata)
- for name,url,iconimage,fanart,description in match:
- # addDir(name,url,1,iconimage,fanart,description)
- buildotherlist.addItem('[COLOR=goldenrod]' + name + '[/COLOR]')
- count = count + 1
- hidecontrols()
- buildotherlist.setVisible(True)
- if count > 11:
- scrolldownimage.setVisible(True)
- else:
- scrolldownimage.setVisible(False)
- if count > 0:
- browsebuildsbutton.controlDown(buildotherlist)
- buildotherlist.controlUp(browsebuildsbutton)
- browseaddonsbutton.controlDown(buildotherlist)
- browsebuildsbutton.controlDown(buildotherlist)
- #browserepobutton.controlDown(buildotherlist)
- maintenancebutton.controlDown(buildotherlist)
- tweaksbutton.controlDown(buildotherlist)
- morebutton.controlDown(buildotherlist)
- settingsbutton.controlDown(buildotherlist)
- buildotherlist.controlRight(installbuildbutton)
- installbuildbutton.controlLeft(buildotherlist)
- installbuildbutton.controlUp(freshstartbutton)
- installbuildbutton.controlDown(repairbuildbutton)
- # installbuildbutton.controlRight(votebuildbutton)
- freshstartbutton.controlUp(browsebuildsbutton)
- freshstartbutton.controlDown(installbuildbutton)
- freshstartbutton.controlLeft(buildotherlist)
- repairbuildbutton.controlUp(installbuildbutton)
- repairbuildbutton.controlDown(votebuildbutton)
- repairbuildbutton.controlLeft(buildotherlist)
- votebuildbutton.controlUp(repairbuildbutton)
- votebuildbutton.controlLeft(buildotherlist)
- global windowimage
- #windowimage.setImage(fanart)
- windowimage.setVisible(True)
- global namelabel
- #namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
- namelabel.setVisible(True)
- #authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
- authorlabel.setVisible(True)
- voteslabel.setVisible(True)
- votestextlabel.setVisible(True)
- #voteslabel.setLabel(label=votes)
- downloadslabel.setVisible(True)
- downloadstextlabel.setVisible(True)
- #downloadslabel.setLabel(label=downloads)
- ratingtextlabel.setVisible(True)
- #showrating(rating, votesint)
- installbuildbutton.setVisible(True)
- votebuildbutton.setVisible(True)
- freshstartbutton.setVisible(True)
- repairbuildbutton.setVisible(True)
- sizelabel.setVisible(True)
- sizetextlabel.setVisible(True)
- if loginstatus == 'mac0':
- votebuildbutton.setEnabled(False)
- else:
- votebuildbutton.setEnabled(True)
- name2 = buildotherlist.getListItem(buildotherlist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in name2:
- opentag = name2.find(']')
- firstpart = name2[opentag+1:]
- closetag = firstpart.find('[')
- name2 = firstpart[:closetag]
- count = 0
- for name,url,iconimage,fanart,description in match:
- if name2 == name:
- namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
- windowimage.setImage(fanart)
- count = count + 1
- try:
- buildlistotherraw
- except:
- url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getbuildsother&time=' + datetime.datetime.now().strftime('%S')
- if debuglog == "true":
- print '@ares: buildlistotherurl...'
- print url
- req = urllib2.Request(url)
- req.add_header('User-Agent', aresagent)
- response = urllib2.urlopen(req)
- buildlistotherraw = response.read()
- if debuglog == "true":
- print ' '
- print '@ares: buildlistotherraw...'
- print ' '
- print buildlistotherraw
- data = json.loads(buildlistotherraw)
- for entry in data:
- if entry['name'] == name2:
- if debuglog == "true":
- print '@ares: build name found...'
- # print '@ares: buidinfo-rating: ' + entry['rating']
- # print '@ares: buidinfo-votes: ' + entry['votes']
- # print '@ares: buidinfo-downloads: ' + entry['downloads']
- global rating
- rating = entry['rating']
- votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
- votesint = entry['votes']
- downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
- downloadsint = entry['downloads']
- voteslabel.setVisible(True)
- votestextlabel.setVisible(True)
- voteslabel.setLabel(label=votes)
- downloadslabel.setVisible(True)
- downloadstextlabel.setVisible(True)
- downloadslabel.setLabel(label=downloads)
- ratingtextlabel.setVisible(True)
- showrating(rating, votesint)
- break
- #global authorlabel
- #authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]')
- #authorlabel.setVisible(True)
- voteslabel.setVisible(True)
- checkfile = os.path.join(datadir, name + '.zip')
- #print checkfile
- if os.path.isfile(checkfile):
- repairbuildbutton.setEnabled(True)
- else:
- repairbuildbutton.setEnabled(False)
- downloadslabel.setVisible(True)
- ratingtextlabel.setVisible(True)
- freshstartbutton.setVisible(True)
- installbuildbutton.setVisible(True)
- votebuildbutton.setVisible(True)
- repairbuildbutton.setVisible(True)
- if loginstatus == 'mac0':
- votebuildbutton.setEnabled(False)
- else:
- votebuildbutton.setEnabled(True)
- if count > 0:
- window.setFocus(buildotherlist)
- buildotherlist.selectItem(0)
- else:
- window.setFocus(browsebuildsbutton)
- def buildfeaturedselect():
- global buildlistraw
- global name
- data = json.loads(buildlistraw)
- for entry in data:
- if entry['name'] == name:
- url = entry['url']
- f = urllib2.urlopen(url)
- size= f.headers["Content-Length"]
- size = float(size)
- size = size /1024/1024
- #size = round(size)
- sizelabel.setLabel('[COLOR=darkgray]' + "%.2f" % size + '[/COLOR]')
- break
- window.setFocus(installbuildbutton)
- def buildtoherselect():
- global wizarddata
- if currentlist == "blackbox":
- window.setFocus(installbuildbutton)
- return()
- name2 = buildotherlist.getListItem(buildotherlist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in name2:
- opentag = name2.find(']')
- firstpart = name2[opentag+1:]
- closetag = firstpart.find('[')
- name2 = firstpart[:closetag]
- match = re.compile('name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)".+?escription="(.+?)"').findall(wizarddata)
- for name,url,iconimage,fanart,description in match:
- if name == name2:
- req = urllib2.Request(url)
- req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
- f = urllib2.urlopen(req)
- size= f.headers["Content-Length"]
- size = float(size)
- size = size /1024/1024
- #size = round(size)
- sizelabel.setLabel("%.2f" % size)
- break
- window.setFocus(installbuildbutton)
- def blackbox1():
- global buildlistotherraw
- global currentlist
- global authorlabel
- global selectname
- global blackboxdata
- currentlist = "blackbox"
- downloadslabel.setLabel(' ')
- voteslabel.setLabel(' ')
- authorlabel.setLabel(' ')
- buildotherlist.reset()
- count = 0
- # dialog = xbmcgui.Dialog()
- # dialog.ok("Result", "Black Box aye aye")
- CHECKURL = "http://tbbwizard.co.uk"
- url = CHECKURL + "/pod/curr_builds.php"
- try:
- req = urllib2.Request(url)
- req.add_header('User-Agent', 'Kodi/Ares Wizard')
- response = urllib2.urlopen(req)
- data = response.read()
- except:
- dialog = xbmcgui.Dialog()
- dialog.ok('Ares Wizard', 'Failed to communicate with BlackBox server')
- return()
- blackboxdata = json.loads(data)
- for build in blackboxdata:
- buildotherlist.addItem('[COLOR=goldenrod]' + build['bfriendlyname'] + '[/COLOR]')
- #addDir(build['bfriendlyname'] + ' - ' + build['bversion'],build['bslug'],5,build['bicon'],FANART,'')
- count = count + 1
- hidecontrols()
- buildotherlist.setVisible(True)
- if count > 11:
- scrolldownimage.setVisible(True)
- else:
- scrolldownimage.setVisible(False)
- if count > 0:
- browsebuildsbutton.controlDown(buildotherlist)
- buildotherlist.controlUp(browsebuildsbutton)
- browseaddonsbutton.controlDown(buildotherlist)
- browsebuildsbutton.controlDown(buildotherlist)
- #browserepobutton.controlDown(buildotherlist)
- maintenancebutton.controlDown(buildotherlist)
- tweaksbutton.controlDown(buildotherlist)
- morebutton.controlDown(buildotherlist)
- settingsbutton.controlDown(buildotherlist)
- buildotherlist.controlRight(installbuildbutton)
- installbuildbutton.controlLeft(buildotherlist)
- installbuildbutton.controlUp(freshstartbutton)
- installbuildbutton.controlDown(repairbuildbutton)
- # installbuildbutton.controlRight(votebuildbutton)
- freshstartbutton.controlUp(browsebuildsbutton)
- freshstartbutton.controlDown(installbuildbutton)
- freshstartbutton.controlLeft(buildotherlist)
- repairbuildbutton.controlUp(installbuildbutton)
- repairbuildbutton.controlDown(votebuildbutton)
- repairbuildbutton.controlLeft(buildotherlist)
- votebuildbutton.controlUp(repairbuildbutton)
- votebuildbutton.controlLeft(buildotherlist)
- global windowimage
- #windowimage.setImage(fanart)
- windowimage.setVisible(True)
- global namelabel
- #namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
- namelabel.setVisible(True)
- #authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
- authorlabel.setVisible(True)
- voteslabel.setVisible(True)
- votestextlabel.setVisible(True)
- #voteslabel.setLabel(label=votes)
- downloadslabel.setVisible(True)
- downloadstextlabel.setVisible(True)
- #downloadslabel.setLabel(label=downloads)
- ratingtextlabel.setVisible(True)
- #showrating(rating, votesint)
- installbuildbutton.setVisible(True)
- votebuildbutton.setVisible(True)
- freshstartbutton.setVisible(True)
- repairbuildbutton.setVisible(True)
- sizelabel.setVisible(False)
- sizetextlabel.setVisible(False)
- if loginstatus == 'mac0':
- votebuildbutton.setEnabled(False)
- else:
- votebuildbutton.setEnabled(True)
- name2 = buildotherlist.getListItem(buildotherlist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in name2:
- opentag = name2.find(']')
- firstpart = name2[opentag+1:]
- closetag = firstpart.find('[')
- name2 = firstpart[:closetag]
- # count = 0
- try:
- buildlistotherraw
- except:
- url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getbuildsother&time=' + datetime.datetime.now().strftime('%S')
- if debuglog == "true":
- print '@ares: buildlistotherurl...'
- print url
- req = urllib2.Request(url)
- req.add_header('User-Agent', aresagent)
- response = urllib2.urlopen(req)
- buildlistotherraw = response.read()
- if debuglog == "true":
- print ' '
- print '@ares: buildlistotherraw...'
- print ' '
- print buildlistotherraw
- data = json.loads(buildlistotherraw)
- for entry in data:
- if entry['name'] == name2:
- if debuglog == "true":
- print ' '
- print '@ares: build name found...'
- # print '@ares: buidinfo-rating: ' + entry['rating']
- # print '@ares: buidinfo-votes: ' + entry['votes']
- # print '@ares: buidinfo-downloads: ' + entry['downloads']
- global rating
- rating = entry['rating']
- votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
- votesint = entry['votes']
- downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
- downloadsint = entry['downloads']
- voteslabel.setVisible(True)
- votestextlabel.setVisible(True)
- voteslabel.setLabel(label=votes)
- downloadslabel.setVisible(True)
- downloadstextlabel.setVisible(True)
- downloadslabel.setLabel(label=downloads)
- ratingtextlabel.setVisible(True)
- showrating(rating, votesint)
- break
- #global authorlabel
- #authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]')
- #authorlabel.setVisible(True)
- voteslabel.setVisible(True)
- checkfile = os.path.join(datadir, name2 + '.zip')
- #print checkfile
- if os.path.isfile(checkfile):
- repairbuildbutton.setEnabled(True)
- else:
- repairbuildbutton.setEnabled(False)
- downloadslabel.setVisible(True)
- ratingtextlabel.setVisible(True)
- freshstartbutton.setVisible(True)
- installbuildbutton.setVisible(True)
- votebuildbutton.setVisible(True)
- repairbuildbutton.setVisible(True)
- if loginstatus == 'mac0':
- votebuildbutton.setEnabled(False)
- else:
- votebuildbutton.setEnabled(True)
- if count > 0:
- window.setFocus(buildotherlist)
- buildotherlist.selectItem(0)
- selectname = buildotherlist.getListItem(buildotherlist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in selectname:
- opentag = selectname.find(']')
- firstpart = selectname[opentag+1:]
- closetag = firstpart.find('[')
- sizelabel.setLabel('[COLOR=darkgray]' + strings.getstring("pressonbuild") + '[/COLOR]')
- selectname = firstpart[:closetag]
- for build in blackboxdata:
- if selectname == build['bfriendlyname']:
- desticon = build['bicon']
- destfanart = build['bicon']
- destdescr = build['bfriendlyname']
- bslug = build['bslug']
- break
- windowimage.setImage(destfanart)
- else:
- window.setFocus(browsebuildsbutton)
- def blackbox2():
- global buildlistotherraw
- global currentlist
- global selectname
- global buildlistotherraw
- global blackboxdata
- global bslug
- global deviceid
- global mac
- global username
- CHECKURL = "http://tbbwizard.co.uk"
- url = CHECKURL + "/pod/build.php?" + "b=" + bslug
- req = urllib2.Request(url)
- req.add_header('User-Agent', 'Kodi/Ares Wizard')
- response = urllib2.urlopen(req)
- data = response.read()
- parsed = json.loads(data)
- if parsed.get('auth'):
- url = parsed.get('url')
- id = parsed.get('id')
- # dialog = xbmcgui.Dialog()
- # dialog.ok("Result", url)
- result = manageaddon.installbuild(selectname, url, deviceid, mac, username, 'blackbox', id)
- if result == "kodirunning":
- if xbmc.getCondVisibility('system.platform.android'):
- hidecontrols()
- # buildinstallpng
- backimage.setImage(buildinstallpng)
- loginbutton.setEnabled(False)
- browsebuildsbutton.setEnabled(False)
- browseaddonsbutton.setEnabled(False)
- backupbutton.setEnabled(False)
- maintenancebutton.setEnabled(False)
- tweaksbutton.setEnabled(False)
- morebutton.setEnabled(False)
- settingsbutton.setEnabled(False)
- closebutton.setEnabled(False)
- if result == 'downloadfalse':
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("downloadfailed2"))
- elif result == 'notvalidzip':
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("notvalidzip"))
- elif result == 'unzipfail':
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("unzipfail"))
- else:
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("kodinotclosed"))
- else:
- dialog = xbmcgui.Dialog()
- dialog.ok("Message from The Black Box", parsed.get('etit'), parsed.get('emsg'))
- def tweakslistselect():
- name = tweakslist.getListItem(tweakslist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in name:
- opentag = name.find(']')
- firstpart = name[opentag+1:]
- closetag = firstpart.find('[')
- name = firstpart[:closetag]
- if name == "Primewire\\1Channel: Blocked URL fix":
- window.setFocus(unblockurlbutton)
- if name == "IceFilms: Blocked URL fix":
- window.setFocus(unblockurlbutton)
- if name == "Advanced Settings Wizard":
- window.setFocus(tweakcache_page1button)
- def speedtestfunc():
- speedtestresult = speedtest.speedtest()
- if speedtestresult == "uploadfail":
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("speedtestuploadfailed"))
- return()
- # currentdl = speedtestresult[1]
- # currentdl = "%.2f" % currentdl
- # currentul = speedtestresult[3]
- # currentul = "%.2f" % currentul
- # currentping = speedtestresult[5]
- # currentserver = speedtestresult[6]
- # dialog = xbmcgui.Dialog()
- # dialog.ok("string", str(currentdl), str(currentul), str(currentping))
- # dialog = xbmcgui.Dialog()
- # dialog.ok("string", str(currentserver))
- randomnumber = random.randrange(10000)
- newfolder = os.path.join(datapath, 'speedtest-' + str(randomnumber))
- os.mkdir(newfolder)
- speedtest3 = os.path.join(datapath, 'speedtest3.png')
- speedtest2 = os.path.join(datapath, 'speedtest2.png')
- speedtest1 = os.path.join(datapath, 'speedtest1.png')
- speedtest3temp = os.path.join(newfolder, 'speedtest3.png')
- speedtest2temp = os.path.join(newfolder, 'speedtest2.png')
- speedtest1temp = os.path.join(newfolder, 'speedtest1.png')
- if os.path.isfile(speedtest3):
- os.remove(speedtest3)
- if os.path.isfile(speedtest2):
- os.rename(speedtest2, speedtest3)
- shutil.copyfile(speedtest3, speedtest3temp)
- if os.path.isfile(speedtest1):
- os.rename(speedtest1, speedtest2)
- shutil.copyfile(speedtest2, speedtest2temp)
- req = urllib2.Request(speedtestresult[0])
- req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
- response = urllib2.urlopen(req)
- reporaw = response.read()
- file = open(speedtest1, "wb")
- file.write(reporaw)
- file.close()
- shutil.copyfile(speedtest1, speedtest1temp)
- if os.path.isfile(speedtest3):
- speedtestimage3.setImage(speedtest3temp)
- else:
- speedtestimage3.setImage(os.path.join(images_path, 'nodata.png'))
- if os.path.isfile(speedtest2):
- speedtestimage2.setImage(speedtest2temp)
- else:
- speedtestimage2.setImage(os.path.join(images_path, 'nodata.png'))
- if os.path.isfile(speedtest1):
- speedtestimage.setImage(speedtest1temp)
- else:
- speedtestimage.setImage(os.path.join(images_path, 'nodata.png'))
- time.sleep(5)
- shutil.rmtree(newfolder)
- def morelistselect():
- name = morelist.getListItem(morelist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in name:
- opentag = name.find(']')
- firstpart = name[opentag+1:]
- closetag = firstpart.find('[')
- name = firstpart[:closetag]
- if name == "System Information":
- systeminfo()
- window.setFocus(morebutton)
- if name == "Upload Kodi Log":
- maintenance.uploadlog()
- if name == "Internet Speed Test":
- speedtest1 = os.path.join(datapath, 'speedtest1.png')
- if os.path.isfile(speedtest1):
- speedtestimage.setImage(speedtest1)
- else:
- speedtestimage.setImage(os.path.join(images_path, 'nodata.png'))
- speedtestimage.setVisible(True)
- speedtest2 = os.path.join(datapath, 'speedtest2.png')
- if os.path.isfile(speedtest2):
- speedtestimage2.setImage(speedtest2)
- else:
- speedtestimage2.setImage(os.path.join(images_path, 'nodata.png'))
- speedtestimage2.setVisible(True)
- speedtest3 = os.path.join(datapath, 'speedtest3.png')
- if os.path.isfile(speedtest3):
- speedtestimage3.setImage(speedtest3)
- else:
- speedtestimage3.setImage(os.path.join(images_path, 'nodata.png'))
- speedtestimage3.setVisible(True)
- dospeedtestbutton.setVisible(True)
- speedtestprevlabel.setVisible(True)
- window.setFocus(dospeedtestbutton)
- dospeedtestbutton.controlLeft(morelist)
- dospeedtestbutton.controlUp(morebutton)
- morelist.controlRight(dospeedtestbutton)
- if name == "Erase all Data/Fresh Start":
- freshstartprompt = xbmcgui.Dialog().yesno(strings.getstring("areswizard"), strings.getstring("buildinstallfreshstart1"), '', strings.getstring("buildinstallfreshstart2"), yeslabel='Yes',nolabel='No')
- if freshstartprompt == 1:
- manageaddon.freshstart()
- if debuglog == "true":
- print '----------------------------------'
- print '--> kodi still running <--'
- print '-----------------------------------'
- xbmc.executebuiltin("ReloadSkin()")
- hidecontrols()
- # buildinstallpng
- backimage.setImage(buildinstallpng)
- loginbutton.setEnabled(False)
- browsebuildsbutton.setEnabled(False)
- browseaddonsbutton.setEnabled(False)
- backupbutton.setEnabled(False)
- maintenancebutton.setEnabled(False)
- tweaksbutton.setEnabled(False)
- morebutton.setEnabled(False)
- settingsbutton.setEnabled(False)
- closebutton.setEnabled(False)
- if name == "Force Close Kodi":
- manageaddon.killkodi()
- def setAnimation(control):
- # Set fade animation for all add-on window controls
- control.setAnimations([('WindowOpen', 'effect=fade start=0 end=100 time=500',),
- ('WindowClose', 'effect=fade start=100 end=0 time=500',)])
- def getbuilddetails():
- global wizarddata
- global currentlist
- global buildlistraw
- global selectname
- if currentlist == "buildother":
- selectname = buildotherlist.getListItem(buildotherlist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in selectname:
- opentag = selectname.find(']')
- firstpart = selectname[opentag+1:]
- closetag = firstpart.find('[')
- selectname = firstpart[:closetag]
- match = re.compile('name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)".+?escription="(.+?)"').findall(wizarddata)
- for name,url,iconimage,fanart,description in match:
- if selectname == name:
- url = url
- break
- result = manageaddon.installbuild(selectname, url, deviceid, mac, username, 'normal', '')
- if result == "kodirunning":
- if xbmc.getCondVisibility('system.platform.android'):
- hidecontrols()
- # buildinstallpng
- backimage.setImage(buildinstallpng)
- loginbutton.setEnabled(False)
- browsebuildsbutton.setEnabled(False)
- browseaddonsbutton.setEnabled(False)
- backupbutton.setEnabled(False)
- maintenancebutton.setEnabled(False)
- tweaksbutton.setEnabled(False)
- morebutton.setEnabled(False)
- settingsbutton.setEnabled(False)
- closebutton.setEnabled(False)
- if result == 'downloadfalse':
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("downloadfailed2"))
- elif result == 'notvalidzip':
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("notvalidzip"))
- elif result == 'unzipfail':
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("unzipfail"))
- else:
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("kodinotclosed"))
- else:
- selectname = buildlist.getListItem(buildlist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in selectname:
- opentag = selectname.find(']')
- firstpart = selectname[opentag+1:]
- closetag = firstpart.find('[')
- selectname = firstpart[:closetag]
- data = json.loads(buildlistraw)
- for entry in data:
- if entry['name'] == selectname:
- url = entry['url']
- iconimage = 'http://' + entry['icon']
- descr = entry['descr']
- fanart = 'http://' + entry['icon']
- author = entry['author']
- rating = entry['rating']
- votes = entry['votes']
- votesint = entry['votes']
- global downloads
- downloads = int(entry['downloads'])
- # dialog = xbmcgui.Dialog()
- # dialog.ok(name, "URL: " + url + "\n" + "Iconimage: " + iconimage + "\n" + "Descr: " + descr + "\n" + "Fanart: " + fanart, "", "")
- result = manageaddon.installbuild(selectname, url, deviceid, mac, username, 'normal', '')
- if result == "kodirunning":
- hidecontrols()
- # buildinstallpng
- backimage.setImage(buildinstallpng)
- loginbutton.setEnabled(False)
- browsebuildsbutton.setEnabled(False)
- browseaddonsbutton.setEnabled(False)
- backupbutton.setEnabled(False)
- maintenancebutton.setEnabled(False)
- tweaksbutton.setEnabled(False)
- morebutton.setEnabled(False)
- settingsbutton.setEnabled(False)
- closebutton.setEnabled(False)
- if result == 'downloadfalse':
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("downloadfailed2"))
- elif result == 'notvalidzip':
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("notvalidzip"))
- elif result == 'unzipfail':
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("unzipfail"))
- else:
- pass
- return(result)
- def getaddondetails():
- data = json.loads(addonlistraw)
- for entry in data:
- if entry['name'] == name:
- global url
- url = entry['url']
- global iconimage
- iconimage = 'http://' + entry['icon']
- global descr
- descr = entry['descr']
- global fanart
- fanart = 'http://' + entry['icon']
- global version
- version = entry['version']
- global addonname
- addonname = entry['name']
- global addonpath
- addonpath = entry['addonpath']
- global addontype
- addontype = entry['type']
- global downloads
- downloads = int(entry['downloads'])
- global repopath
- repopath = entry['devrepo']
- def getrepodetails():
- global url
- global iconimage
- global descr
- global fanart
- global downloads
- global addonpath
- global addontype
- data = json.loads(repolistraw)
- for entry in data:
- if entry['name'] == name:
- url = entry['url']
- iconimage = 'http://' + entry['icon']
- descr = entry['descr']
- fanart = 'http://' + entry['icon']
- downloads = int(entry['downloads'])
- addontype = "repo"
- addonpath = entry['repopath']
- def getbuildmainraw():
- global buildmainraw
- url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getbuildmain&time=' + datetime.datetime.now().strftime('%S')
- if debuglog == "true":
- print '@ares: buildmainurl...'
- print url
- req = urllib2.Request(url)
- req.add_header('User-Agent', aresagent)
- response = urllib2.urlopen(req)
- buildmainraw = response.read()
- def showbuildmenu():
- global currentlist
- global buildmainraw
- buildmainlist.reset()
- buildotherlist.reset()
- buildlist.reset()
- currentlist = "buildmain"
- hidecontrols()
- try:
- buildmainraw
- except:
- getbuildmainraw()
- count = 1
- if debuglog == "true":
- print '@ares: buildmainraw....'
- print buildmainraw
- buildmainlist.addItem('[COLOR=goldenrod]Featured Builds[/COLOR]')
- buildmainlist.addItem('[COLOR=goldenrod]The Black Box Builds[/COLOR]')
- times = 1
- working = 0
- while working == 0:
- try:
- data = json.loads(buildmainraw)
- working = 1
- except:
- dp = xbmcgui.DialogProgress()
- dp.create(strings.getstring("areswizard"), 'Getting data...', 'Attempt: ' + str(times), ' ')
- times = times + 1
- time.sleep(3)
- getbuildmainraw()
- dp.close
- if times > 3:
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), "Failed to get data from server. This may just be temporary, please try again.")
- window.setFocus(browsebuildsbutton)
- return()
- for entry in data:
- buildmainlist.addItem('[COLOR=goldenrod]' + entry['name'] + '[/COLOR]')
- count = count + 1
- buildmainlist.setVisible(True)
- browsebuildsbutton.controlDown(buildmainlist)
- buildmainlist.controlUp(browsebuildsbutton)
- window.setFocus(buildmainlist)
- #buildmainlist.selectItem(0)
- if count > 10:
- scrolldownimage.setVisible(True)
- else:
- scrolldownimage.setVisible(False)
- def showotherbuilds():
- pass
- def getfeaturedbuildlist():
- global buildlistraw
- if showadult == "true":
- url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getbuildsincadult&time=' + datetime.datetime.now().strftime('%S')
- else:
- url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getbuilds&time=' + datetime.datetime.now().strftime('%S')
- if debuglog == "true":
- print '@ares: buildlisturl...'
- print url
- req = urllib2.Request(url)
- req.add_header('User-Agent', aresagent)
- response = urllib2.urlopen(req)
- buildlistraw = response.read()
- def showfeaturedbuildslist():
- global buildlistraw
- global currentlist
- currentlist = "featuredbuild"
- hidecontrols()
- try:
- buildlistraw
- except:
- getfeaturedbuildlist()
- count = 0
- if debuglog == "true":
- print '@ares: Buildlistraw....'
- print buildlistraw
- times = 1
- working = 0
- while working == 0:
- try:
- data = json.loads(buildlistraw)
- working = 1
- except:
- dp = xbmcgui.DialogProgress()
- #dp.create(strings.getstring("areswizard"), 'Getting data...', 'Attempt: ' + str(times), ' ')
- dp.create(strings.getstring("areswizard"), 'Getting data...', ' ', ' ')
- times = times + 1
- time.sleep(3)
- getfeaturedbuildlist()
- dp.close
- if times > 3:
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), "Failed to get data from server. This may just be temporary, please try again.")
- window.setFocus(browsebuildsbutton)
- return()
- for entry in data:
- buildlist.addItem('[COLOR=goldenrod]' + entry['name'] + '[/COLOR]')
- count = count + 1
- buildlist.setVisible(True)
- if count > 11:
- scrolldownimage.setVisible(True)
- else:
- scrolldownimage.setVisible(False)
- browseaddonsbutton.controlDown(buildlist)
- browsebuildsbutton.controlDown(buildlist)
- #browserepobutton.controlDown(buildlist)
- maintenancebutton.controlDown(buildlist)
- tweaksbutton.controlDown(buildlist)
- morebutton.controlDown(buildlist)
- settingsbutton.controlDown(buildlist)
- buildlist.controlRight(installbuildbutton)
- installbuildbutton.controlLeft(buildlist)
- installbuildbutton.controlUp(freshstartbutton)
- installbuildbutton.controlDown(repairbuildbutton)
- # installbuildbutton.controlRight(votebuildbutton)
- freshstartbutton.controlUp(browsebuildsbutton)
- freshstartbutton.controlDown(installbuildbutton)
- freshstartbutton.controlLeft(buildlist)
- repairbuildbutton.controlUp(installbuildbutton)
- repairbuildbutton.controlDown(votebuildbutton)
- repairbuildbutton.controlLeft(buildlist)
- votebuildbutton.controlUp(repairbuildbutton)
- votebuildbutton.controlLeft(buildlist)
- # if userlevel == "staff" or userlevel == "admin":
- # buildlist.controlUp(browsebuildsbutton)
- name = buildlist.getListItem(buildlist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in name:
- opentag = name.find(']')
- firstpart = name[opentag+1:]
- closetag = firstpart.find('[')
- name = firstpart[:closetag]
- data = json.loads(buildlistraw)
- for entry in data:
- if entry['name'] == name:
- url = entry['url']
- iconimage = 'http://' + entry['icon']
- descr = entry['descr']
- fanart = 'http://' + entry['icon']
- author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
- global rating
- rating = entry['rating']
- votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
- votesint = entry['votes']
- downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
- downloadsint = entry['downloads']
- global windowimage
- windowimage.setImage(fanart)
- windowimage.setVisible(True)
- global namelabel
- namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
- namelabel.setVisible(True)
- global authorlabel
- authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
- authorlabel.setVisible(True)
- voteslabel.setVisible(True)
- votestextlabel.setVisible(True)
- voteslabel.setLabel(label=votes)
- downloadslabel.setVisible(True)
- downloadstextlabel.setVisible(True)
- downloadslabel.setLabel(label=downloads)
- ratingtextlabel.setVisible(True)
- showrating(rating, votesint)
- installbuildbutton.setVisible(True)
- votebuildbutton.setVisible(True)
- freshstartbutton.setVisible(True)
- repairbuildbutton.setVisible(True)
- sizelabel.setVisible(True)
- sizetextlabel.setVisible(True)
- if loginstatus == 'mac0':
- votebuildbutton.setEnabled(False)
- else:
- votebuildbutton.setEnabled(True)
- window.setFocus(buildlist)
- # buildlist.selectItem(0)
- def getaddonlistraw():
- global addonlistraw
- if showadult == "true":
- url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getaddonsincadult&time=' + datetime.datetime.now().strftime('%S')
- else:
- url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getaddons&time=' + datetime.datetime.now().strftime('%S')
- req = urllib2.Request(url)
- req.add_header('User-Agent', aresagent)
- response = urllib2.urlopen(req)
- addonlistraw = response.read()
- def showaddontypelist():
- #xbmc.executebuiltin('Notification(show, addontypelist, time=50)')
- global addonlistraw
- hidecontrols()
- try:
- addonlistraw
- except:
- getaddonlistraw()
- addontypelist.addItem('[COLOR=goldenrod]Video Addons[/COLOR]')
- addontypelist.addItem('[COLOR=goldenrod]Program Addons[/COLOR]')
- addontypelist.addItem('[COLOR=goldenrod]Repositories[/COLOR]')
- addontypelist.setVisible(True)
- #window.setFocus(addontypelist)
- browseaddonsbutton.controlDown(addontypelist)
- browsebuildsbutton.controlDown(addontypelist)
- backupbutton.controlDown(addontypelist)
- maintenancebutton.controlDown(addontypelist)
- tweaksbutton.controlDown(addontypelist)
- morebutton.controlDown(addontypelist)
- settingsbutton.controlDown(addontypelist)
- # if userlevel == "staff" or userlevel == "admin":
- # addontypelist.controlUp(browseaddonsbutton)
- def getrepolistraw():
- global repolistraw
- if showadult == "true":
- url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getreposincadult&time=' + datetime.datetime.now().strftime('%S')
- else:
- url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getrepos&time=' + datetime.datetime.now().strftime('%S')
- req = urllib2.Request(url)
- req.add_header('User-Agent', aresagent)
- response = urllib2.urlopen(req)
- repolistraw = response.read()
- def showrepolist():
- global repolistraw
- global currentlist
- currentlist = "repo"
- repolist.reset()
- hidecontrols()
- try:
- repolistraw
- except:
- getrepolistraw()
- times = 1
- working = 0
- while working == 0:
- try:
- data = json.loads(repolistraw)
- working = 1
- except:
- dp = xbmcgui.DialogProgress()
- #dp.create(strings.getstring("areswizard"), 'Getting data...', 'Attempt: ' + str(times), ' ')
- dp.create(strings.getstring("areswizard"), 'Getting data...', ' ', ' ')
- times = times + 1
- time.sleep(3)
- getrepolistraw()
- dp.close
- if times > 3:
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), "Failed to get data from server. This may just be temporary, please try again.")
- window.setFocus(browseaddonsbutton)
- return()
- for entry in data:
- repopath = entry['repopath']
- destfolder = translate('special://home/addons/' + repopath + '/addon.xml')
- if os.path.isfile(destfolder):
- repolist.addItem('[COLOR=lime]' + entry['name'] + '[/COLOR]')
- else:
- repolist.addItem('[COLOR=fuchsia]' + entry['name'] + '[/COLOR]')
- #window.connect(repolist, lambda: getaddondetails())
- # window.connect(buildlist, lambda: xbmc.executebuiltin('Notification(Note!,{0} selected.)'.format(
- # buildlist.getListItem(buildlist.getSelectedPosition()).getLabel())))
- repolist.setVisible(True)
- scrolldownimage.setVisible(True)
- browseaddonsbutton.controlDown(repolist)
- browsebuildsbutton.controlDown(repolist)
- backupbutton.controlDown(repolist)
- maintenancebutton.controlDown(repolist)
- tweaksbutton.controlDown(repolist)
- morebutton.controlDown(repolist)
- settingsbutton.controlDown(repolist)
- repolist.controlRight(installaddonbutton)
- installaddonbutton.controlLeft(repolist)
- installaddonbutton.controlRight(voterepobutton)
- installaddonbutton.controlUp(browseaddonsbutton)
- voterepobutton.controlLeft(installaddonbutton)
- voterepobutton.controlRight(uninstalladdonbutton)
- voterepobutton.controlUp(browseaddonsbutton)
- uninstalladdonbutton.controlLeft(voterepobutton)
- uninstalladdonbutton.controlUp(browseaddonsbutton)
- # if userlevel == "staff" or userlevel == "admin":
- # repolist.controlUp(browserepobutton)
- #repolist.selectItem(0)
- name = repolist.getListItem(repolist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in name:
- opentag = name.find(']')
- firstpart = name[opentag+1:]
- closetag = firstpart.find('[')
- #global name
- name = firstpart[:closetag]
- data = json.loads(repolistraw)
- for entry in data:
- if entry['name'] == name:
- url = entry['url']
- iconimage = 'http://' + entry['icon']
- descr = entry['descr']
- fanart = 'http://' + entry['icon']
- rating = entry['rating']
- votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
- votesint = entry['votes']
- author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
- repopath = entry['repopath']
- downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
- downloadsint = entry['downloads']
- global windowimage3
- windowimage3.setImage(fanart)
- windowimage3.setVisible(True)
- voteslabel.setVisible(True)
- votestextlabel.setVisible(True)
- voteslabel.setLabel(label=votes)
- global authorlabel
- authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
- authorlabel.setVisible(True)
- downloadslabel.setVisible(True)
- downloadstextlabel.setVisible(True)
- downloadslabel.setLabel(label=downloads)
- ratingtextlabel.setVisible(True)
- showrating(rating, votesint)
- uninstalladdonbutton.setVisible(True)
- installaddonbutton.setVisible(True)
- voterepobutton.setVisible(True)
- window.setFocus(repolist)
- def getaddons():
- global name
- #xbmc.executebuiltin('Notification(get, addons, time=50)')
- name = addontypelist.getListItem(addontypelist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in name:
- opentag = name.find(']')
- firstpart = name[opentag+1:]
- closetag = firstpart.find('[')
- name = firstpart[:closetag]
- if name == "Video Addons":
- showvideoaddonslist()
- if name == "Program Addons":
- showprogramaddonslist()
- if name == "Repositories":
- showrepolist()
- def showvideoaddonslist():
- #xbmc.executebuiltin('Notification(video, addon, time=50)')
- global currentlist
- currentlist = "videoaddon"
- addontypelist.setVisible(False)
- addonlist.reset()
- #addonlist.addItem('..')
- times = 1
- working = 0
- while working == 0:
- try:
- data = json.loads(addonlistraw)
- working = 1
- except:
- dp = xbmcgui.DialogProgress()
- #dp.create(strings.getstring("areswizard"), 'Getting data...', 'Attempt: ' + str(times), ' ')
- dp.create(strings.getstring("areswizard"), 'Getting data...', ' ', ' ')
- times = times + 1
- time.sleep(3)
- getaddonlistraw()
- dp.close
- if times > 3:
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), "Failed to get data from server. This may just be temporary, please try again.")
- window.setFocus(browseaddonsbutton)
- return()
- for entry in data:
- if entry['type'] == "Video":
- url = entry['url']
- iconimage = 'http://' + entry['icon']
- descr = entry['descr']
- fanart = 'http://' + entry['icon']
- author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
- global rating
- rating = entry['rating']
- votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
- votesint = entry['votes']
- version = entry['version']
- addonpath = entry['addonpath']
- checktargetxmlversion(entry['addonpath'])
- if installedversion == " ":
- addonlist.addItem('[COLOR fuchsia]'+entry['name']+'[/COLOR]')
- else:
- if installedversion <> version:
- addonlist.addItem('[COLOR lime]'+entry['name']+'[/COLOR]')
- else:
- addonlist.addItem('[COLOR lime]'+entry['name']+'[/COLOR]')
- addonlist.setVisible(True)
- #addonlist.selectItem(0)
- window.setFocus(addonlist)
- scrolldownimage.setVisible(True)
- #window.connect(installaddonbutton, lambda: installbutton('addon'))
- #window.connect(addonlist, lambda: window.setFocus(installaddonbutton))
- browseaddonsbutton.controlDown(addonlist)
- browsebuildsbutton.controlDown(addonlist)
- backupbutton.controlDown(addonlist)
- maintenancebutton.controlDown(addonlist)
- tweaksbutton.controlDown(addonlist)
- morebutton.controlDown(addonlist)
- settingsbutton.controlDown(addonlist)
- addonlist.controlRight(installaddonbutton)
- installaddonbutton.controlLeft(addonlist)
- installaddonbutton.controlRight(voteaddonbutton)
- installaddonbutton.controlUp(browseaddonsbutton)
- voteaddonbutton.controlLeft(installaddonbutton)
- voteaddonbutton.controlRight(uninstalladdonbutton)
- voteaddonbutton.controlUp(browseaddonsbutton)
- uninstalladdonbutton.controlLeft(voteaddonbutton)
- uninstalladdonbutton.controlRight(addaddonbyrepobutton)
- uninstalladdonbutton.controlUp(browseaddonsbutton)
- addaddonbyrepobutton.controlLeft(uninstalladdonbutton)
- addaddonbyrepobutton.controlRight(updateaddonbutton)
- addaddonbyrepobutton.controlUp(browseaddonsbutton)
- updateaddonbutton.controlLeft(addaddonbyrepobutton)
- updateaddonbutton.controlUp(browseaddonsbutton)
- name = addonlist.getListItem(addonlist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in name:
- opentag = name.find(']')
- firstpart = name[opentag+1:]
- closetag = firstpart.find('[')
- #global name
- name = firstpart[:closetag]
- data = json.loads(addonlistraw)
- for entry in data:
- if entry['name'] == name:
- url = entry['url']
- iconimage = 'http://' + entry['icon']
- descr = entry['descr']
- fanart = 'http://' + entry['icon']
- author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
- rating = entry['rating']
- votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
- votesint = entry['votes']
- addonpath = entry['addonpath']
- version_color = '[COLOR=darkgray]' + entry['version'] + '[/COLOR]'
- version = entry['version']
- downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
- downloadsint = entry['downloads']
- global windowimage2
- windowimage2.setImage(fanart)
- windowimage2.setVisible(True)
- namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
- namelabel.setVisible(True)
- authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
- authorlabel.setVisible(True)
- checktargetxmlversion(addonpath)
- if installedversion == " ":
- statuslabel.setLabel(label='[COLOR fuchsia]Not Installed[/COLOR]')
- installedversionlabel.setLabel(label=installedversion_color)
- installedversionlabel.setVisible(False)
- installedversiontextlabel.setVisible(False)
- elif installedversion <> version:
- statuslabel.setLabel(label='[COLOR=lime]Installed[/COLOR]')
- installedversionlabel.setLabel(label=installedversion_color)
- installedversionlabel.setVisible(True)
- installedversiontextlabel.setVisible(True)
- elif installedversion == version:
- statuslabel.setLabel(label='[COLOR=lime]Installed[/COLOR]')
- installedversionlabel.setLabel(label=installedversion_color)
- installedversionlabel.setVisible(True)
- installedversiontextlabel.setVisible(True)
- else:
- statuslabel.setLabel(label='Unknown')
- installedversionlabel.setLabel(label=installedversion_color)
- installedversionlabel.setVisible(True)
- installedversiontextlabel.setVisible(True)
- statuslabel.setVisible(True)
- statustextlabel.setVisible(True)
- # recversionlabel.setLabel(label=version_color)
- # recversionlabel.setVisible(True)
- # recversiontextlabel.setVisible(True)
- uninstalladdonbutton.setVisible(True)
- installaddonbutton.setVisible(True)
- voteaddonbutton.setVisible(True)
- voteslabel.setLabel(label=votes)
- voteslabel.setVisible(True)
- votestextlabel.setVisible(True)
- downloadslabel.setLabel(label=str(downloads))
- downloadslabel.setVisible(True)
- downloadstextlabel.setVisible(True)
- ratingtextlabel.setVisible(True)
- showrating(rating, votesint)
- if userlevel == "staff" or userlevel == "admin":
- addaddonbyrepobutton.setVisible(True)
- # uninstalladdonbutton.controlDown(addaddonbyrepobutton)
- addaddonbyrepobutton.controlUp(browseaddonsbutton)
- uninstalladdonbutton.controlUp(browseaddonsbutton)
- updateaddonbutton.setVisible(True)
- # addaddonbyrepobutton.controlDown(updateaddonbutton)
- updateaddonbutton.controlUp(browseaddonsbutton)
- def showprogramaddonslist():
- #xbmc.executebuiltin('Notification(video, addon, time=50)')
- global currentlist
- currentlist = "programaddon"
- addontypelist.setVisible(False)
- addonlist.reset()
- #addonlist.addItem('..')
- times = 1
- working = 0
- while working == 0:
- try:
- data = json.loads(addonlistraw)
- working = 1
- except:
- dp = xbmcgui.DialogProgress()
- #dp.create(strings.getstring("areswizard"), 'Getting data...', 'Attempt: ' + str(times), ' ')
- dp.create(strings.getstring("areswizard"), 'Getting data...', ' ', ' ')
- times = times + 1
- time.sleep(3)
- getaddonlistraw()
- dp.close
- if times > 3:
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), "Failed to get data from server. This may just be temporary, please try again.")
- window.setFocus(browseaddonsbutton)
- return()
- for entry in data:
- if entry['type'] == "Program":
- url = entry['url']
- iconimage = 'http://' + entry['icon']
- descr = entry['descr']
- fanart = 'http://' + entry['icon']
- author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
- global rating
- rating = entry['rating']
- votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
- votesint = entry['votes']
- version = entry['version']
- checktargetxmlversion(entry['addonpath'])
- global installedversion2
- installedversion2 = stripcolortags(installedversion)
- global version2
- version2 = stripcolortags(version)
- if installedversion2 == " ":
- addonlist.addItem('[COLOR fuchsia]'+entry['name']+'[/COLOR]')
- else:
- if installedversion2 <> version2:
- addonlist.addItem('[COLOR lime]'+entry['name']+'[/COLOR]')
- else:
- addonlist.addItem('[COLOR lime]'+entry['name']+'[/COLOR]')
- addonlist.setVisible(True)
- #addonlist.selectItem(0)
- window.setFocus(addonlist)
- browseaddonsbutton.controlDown(addonlist)
- browsebuildsbutton.controlDown(addonlist)
- backupbutton.controlDown(addonlist)
- maintenancebutton.controlDown(addonlist)
- tweaksbutton.controlDown(addonlist)
- morebutton.controlDown(addonlist)
- settingsbutton.controlDown(addonlist)
- installaddonbutton.controlUp(browseaddonsbutton)
- addaddonbyrepobutton.controlLeft(addonlist)
- updateaddonbutton.controlLeft(addonlist)
- # if userlevel == "staff" or userlevel == "admin":
- # addontypelist.controlUp(browseaddonsbutton)
- name = addonlist.getListItem(addonlist.getSelectedPosition()).getLabel()
- colortag = "COLOR"
- if colortag in name:
- opentag = name.find(']')
- firstpart = name[opentag+1:]
- closetag = firstpart.find('[')
- #global name
- name = firstpart[:closetag]
- data = json.loads(addonlistraw)
- for entry in data:
- if entry['name'] == name:
- url = entry['url']
- iconimage = 'http://' + entry['icon']
- descr = entry['descr']
- fanart = 'http://' + entry['icon']
- author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
- rating = entry['rating']
- votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
- votesint = entry['votes']
- addonpath = entry['addonpath']
- version_color = '[COLOR=darkgray]' + entry['version'] + '[/COLOR]'
- version = entry['version']
- downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
- downloadsint = entry['downloads']
- global windowimage2
- windowimage2.setImage(fanart)
- windowimage2.setVisible(True)
- namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
- namelabel.setVisible(True)
- authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
- authorlabel.setVisible(True)
- checktargetxmlversion(addonpath)
- if installedversion == " ":
- statuslabel.setLabel(label='[COLOR fuchsia]Not Installed[/COLOR]')
- installedversionlabel.setLabel(label=installedversion_color)
- installedversionlabel.setVisible(False)
- installedversiontextlabel.setVisible(False)
- elif installedversion <> version:
- statuslabel.setLabel(label='[COLOR=lime]Installed[/COLOR]')
- installedversionlabel.setLabel(label=installedversion_color)
- installedversionlabel.setVisible(True)
- installedversiontextlabel.setVisible(True)
- elif installedversion == version:
- statuslabel.setLabel(label='[COLOR=lime]Installed[/COLOR]')
- installedversionlabel.setLabel(label=installedversion_color)
- installedversionlabel.setVisible(True)
- installedversiontextlabel.setVisible(True)
- else:
- statuslabel.setLabel(label='Unknown')
- installedversionlabel.setLabel(label=installedversion_color)
- installedversionlabel.setVisible(True)
- installedversiontextlabel.setVisible(True)
- statuslabel.setVisible(True)
- statustextlabel.setVisible(True)
- # recversionlabel.setLabel(label=version_color)
- # recversionlabel.setVisible(True)
- # recversiontextlabel.setVisible(True)
- uninstalladdonbutton.setVisible(True)
- installaddonbutton.setVisible(True)
- voteaddonbutton.setVisible(True)
- voteslabel.setLabel(label=votes)
- voteslabel.setVisible(True)
- votestextlabel.setVisible(True)
- downloadslabel.setLabel(label=str(downloads))
- downloadslabel.setVisible(True)
- downloadstextlabel.setVisible(True)
- ratingtextlabel.setVisible(True)
- showrating(rating, votesint)
- if userlevel == "staff" or userlevel == "admin":
- addaddonbyrepobutton.setVisible(True)
- uninstalladdonbutton.controlDown(addaddonbyrepobutton)
- addaddonbyrepobutton.controlUp(uninstalladdonbutton)
- updateaddonbutton.setVisible(True)
- addaddonbyrepobutton.controlDown(updateaddonbutton)
- updateaddonbutton.controlUp(addaddonbyrepobutton)
- def checktargetxmlversion(addonpath):
- global installedversion
- global installedversion_color
- #xbmc.executebuiltin('Notification(check, targetxml, time=50)')
- targetxmlpath = translate('special://home/addons' + '/' + addonpath)
- targetxml = os.path.join(targetxmlpath, 'addon.xml')
- # print 'targetxml>>>'
- # print targetxml
- try:
- targetxmlfile = open(targetxml, 'r')
- targetxmlcontents = targetxmlfile.read()
- str1 = targetxmlcontents.find('version=',20)
- str2 = str1 + 9
- str3 = targetxmlcontents[str2:]
- str4 = str3.find('"')
- global installedversion_color
- installedversion_color = '[COLOR=darkgray]' + str3[:str4] + '[/COLOR]'
- installedversion = str3[:str4]
- except:
- installedversion = " "
- installedversion_color = " "
- def maintenance2():
- hidecontrols()
- maintenanceimage.setVisible(True)
- maint_cache_label.setVisible(True)
- maint_cache_label2.setVisible(True)
- maint_packages_label.setVisible(True)
- maint_packages_label2.setVisible(True)
- maint_packages_label3.setVisible(True)
- maint_packages_label4.setVisible(True)
- maint_packages_label5.setVisible(True)
- maint_thumb_label.setVisible(True)
- maint_thumb_label2.setVisible(True)
- maint_thumb_label3.setVisible(True)
- maint_thumb_label4.setVisible(True)
- maint_thumb_label5.setVisible(True)
- maint_cache_label3.setVisible(True)
- maint_cache_label4.setVisible(True)
- maint_cache_label5.setVisible(True)
- maint_cache_label6.setVisible(True)
- maint_cache_label7.setVisible(True)
- maint_cache_green.setVisible(True)
- deletecachebuttonv2.setVisible(True)
- maint_packages_green.setVisible(True)
- maint_thumb_green.setVisible(True)
- deletethumbnailsbuttonv2.setVisible(True)
- deletepackagesbuttonv2.setVisible(True)
- automaintenanceradio.setVisible(True)
- automaintenancefreqeverytime.setVisible(True)
- automaintenancefreqmonthly.setVisible(True)
- automaintenancefreqweekly.setVisible(True)
- automaintenancefreqdaily.setVisible(True)
- automaintenancelabel1.setVisible(True)
- fullautomaintenanceradio.setVisible(True)
- fullyautomaintenancelabel1.setVisible(True)
- fullautomaintcacheradio.setVisible(True)
- fullautomaintpackagesradio.setVisible(True)
- fullautomaintthumbradio.setVisible(True)
- fullyautomaintenancelabel2.setVisible(True)
- fullautomaintweekradio.setVisible(True)
- fullautomaintmonthradio.setVisible(True)
- fullautomaintquarterradio.setVisible(True)
- cacheinclude_genesis.setVisible(True)
- cacheinclude_navix.setVisible(True)
- cacheinclude_ivue.setVisible(True)
- cacheinclude_youtube.setVisible(True)
- cacheinclude_pulsar.setVisible(True)
- cacheinclude_salts.setVisible(True)
- maint_totallocalspacelabel.setVisible(True)
- maint_totallocalfileslabel.setVisible(True)
- browsebuildsbutton.controlDown(deletethumbnailsbuttonv2)
- browseaddonsbutton.controlDown(deletethumbnailsbuttonv2)
- backupbutton.controlDown(deletepackagesbuttonv2)
- maintenancebutton.controlDown(deletepackagesbuttonv2)
- tweaksbutton.controlDown(deletecachebuttonv2)
- morebutton.controlDown(cacheinclude_genesis)
- settingsbutton.controlDown(cacheinclude_navix)
- deletecachebuttonv2.controlUp(maintenancebutton)
- deletethumbnailsbuttonv2.controlUp(maintenancebutton)
- deletepackagesbuttonv2.controlUp(maintenancebutton)
- deletecachebuttonv2.controlLeft(deletepackagesbuttonv2)
- deletethumbnailsbuttonv2.controlRight(deletepackagesbuttonv2)
- deletepackagesbuttonv2.controlRight(deletecachebuttonv2)
- deletepackagesbuttonv2.controlLeft(deletethumbnailsbuttonv2)
- deletepackagesbuttonv2.controlDown(automaintenanceradio)
- deletecachebuttonv2.controlRight(cacheinclude_salts)
- cacheinclude_genesis.controlUp(morebutton)
- cacheinclude_genesis.controlRight(cacheinclude_navix)
- cacheinclude_genesis.controlDown(cacheinclude_youtube)
- cacheinclude_genesis.controlLeft(deletecachebuttonv2)
- cacheinclude_navix.controlUp(settingsbutton)
- cacheinclude_navix.controlLeft(cacheinclude_genesis)
- cacheinclude_navix.controlDown(cacheinclude_ivue)
- cacheinclude_youtube.controlUp(cacheinclude_genesis)
- cacheinclude_youtube.controlDown(cacheinclude_salts)
- cacheinclude_youtube.controlLeft(deletecachebuttonv2)
- cacheinclude_youtube.controlRight(cacheinclude_ivue)
- cacheinclude_ivue.controlUp(cacheinclude_navix)
- cacheinclude_ivue.controlLeft(cacheinclude_youtube)
- cacheinclude_ivue.controlDown(cacheinclude_pulsar)
- cacheinclude_salts.controlUp(cacheinclude_youtube)
- cacheinclude_salts.controlDown(deletecachebuttonv2)
- cacheinclude_salts.controlLeft(deletecachebuttonv2)
- cacheinclude_salts.controlRight(cacheinclude_pulsar)
- cacheinclude_pulsar.controlUp(cacheinclude_ivue)
- cacheinclude_pulsar.controlDown(deletecachebuttonv2)
- cacheinclude_pulsar.controlLeft(cacheinclude_salts)
- deletecachebuttonv2.controlDown(fullautomaintenanceradio)
- automaintenanceradio.controlUp(deletethumbnailsbuttonv2)
- automaintenanceradio.controlDown(automaintenancefreqweekly)
- automaintenancefreqeverytime.controlRight(automaintenancefreqdaily)
- automaintenancefreqeverytime.controlUp(automaintenanceradio)
- automaintenancefreqdaily.controlRight(automaintenancefreqweekly)
- automaintenancefreqdaily.controlUp(automaintenanceradio)
- automaintenancefreqdaily.controlLeft(automaintenancefreqeverytime)
- automaintenancefreqweekly.controlRight(automaintenancefreqmonthly)
- automaintenancefreqweekly.controlUp(automaintenanceradio)
- automaintenancefreqweekly.controlLeft(automaintenancefreqdaily)
- automaintenancefreqmonthly.controlUp(automaintenanceradio)
- automaintenancefreqmonthly.controlLeft(automaintenancefreqweekly)
- deletethumbnailsbuttonv2.controlDown(automaintenanceradio)
- fullautomaintenanceradio.controlUp(deletecachebuttonv2)
- fullautomaintenanceradio.controlDown(fullautomaintpackagesradio)
- fullautomaintpackagesradio.controlUp(fullautomaintenanceradio)
- fullautomaintpackagesradio.controlLeft(fullautomaintcacheradio)
- fullautomaintpackagesradio.controlRight(fullautomaintthumbradio)
- fullautomaintpackagesradio.controlDown(fullautomaintmonthradio)
- fullautomaintcacheradio.controlUp(fullautomaintenanceradio)
- fullautomaintcacheradio.controlRight(fullautomaintpackagesradio)
- fullautomaintcacheradio.controlDown(fullautomaintweekradio)
- fullautomaintthumbradio.controlUp(fullautomaintenanceradio)
- fullautomaintthumbradio.controlLeft(fullautomaintpackagesradio)
- fullautomaintthumbradio.controlDown(fullautomaintquarterradio)
- fullautomaintweekradio.controlUp(fullautomaintcacheradio)
- fullautomaintweekradio.controlRight(fullautomaintmonthradio)
- fullautomaintmonthradio.controlUp(fullautomaintpackagesradio)
- fullautomaintmonthradio.controlLeft(fullautomaintweekradio)
- fullautomaintmonthradio.controlRight(fullautomaintquarterradio)
- fullautomaintquarterradio.controlUp(fullautomaintthumbradio)
- fullautomaintquarterradio.controlLeft(fullautomaintmonthradio)
- try:
- with open(settingsfile, 'r',0) as f:
- config = json.load(f)
- maint_totallocalfileslabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalfilesdeleted") + '[/COLOR]')
- totalfilesdeleted = config['totaltempfiles']
- oldlabel = maint_totallocalfileslabel.getLabel()
- maint_totallocalfileslabel.setLabel(oldlabel + '[COLOR=darkgray]' + totalfilesdeleted + '[/COLOR]')
- maint_totallocalspacelabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalspacegained") + '[/COLOR]')
- totalspacegained = config['totalspacegained']
- totalspacegained2 = int(round(float(totalspacegained)))
- oldlabel = maint_totallocalspacelabel.getLabel()
- maint_totallocalspacelabel.setLabel(oldlabel + '[COLOR=darkgray]' + str(totalspacegained2) + ' MB[/COLOR]')
- automaintenancemode = config['automaintenance']
- if automaintenancemode == "daily":
- automaintenancefreqdaily.setSelected(True)
- automaintenanceradio.setSelected(True)
- automaintenancelabel1.setVisible(True)
- automaintenanceradio.setEnabled(True)
- automaintenancefreqeverytime.setEnabled(True)
- automaintenancefreqmonthly.setEnabled(True)
- automaintenancefreqweekly.setEnabled(True)
- automaintenancefreqdaily.setEnabled(True)
- automaintenancelabel1.setEnabled(True)
- if automaintenancemode == "weekly":
- automaintenancefreqweekly.setSelected(True)
- automaintenanceradio.setSelected(True)
- automaintenanceradio.setEnabled(True)
- automaintenancefreqeverytime.setEnabled(True)
- automaintenancefreqmonthly.setEnabled(True)
- automaintenancefreqweekly.setEnabled(True)
- automaintenancefreqdaily.setEnabled(True)
- automaintenancelabel1.setEnabled(True)
- if automaintenancemode == "montly":
- automaintenancefreqmonthly.setSelected(True)
- automaintenanceradio.setSelected(True)
- automaintenanceradio.setEnabled(True)
- automaintenancefreqeverytime.setEnabled(True)
- automaintenancefreqmonthly.setEnabled(True)
- automaintenancefreqweekly.setEnabled(True)
- automaintenancefreqdaily.setEnabled(True)
- automaintenancelabel1.setEnabled(True)
- if automaintenancemode == "everytime":
- automaintenancefreqeverytime.setSelected(True)
- automaintenanceradio.setSelected(True)
- automaintenanceradio.setEnabled(True)
- automaintenancefreqeverytime.setEnabled(True)
- automaintenancefreqmonthly.setEnabled(True)
- automaintenancefreqweekly.setEnabled(True)
- automaintenancefreqdaily.setEnabled(True)
- automaintenancelabel1.setEnabled(True)
- fullautofreq = config['fullautofreq']
- if fullautofreq == "week":
- fullautomaintcacheradio.setEnabled(True)
- fullautomaintenanceradio.setSelected(True)
- fullautomaintmonthradio.setEnabled(True)
- fullautomaintpackagesradio.setEnabled(True)
- fullautomaintquarterradio.setEnabled(True)
- fullautomaintthumbradio.setEnabled(True)
- fullautomaintweekradio.setEnabled(True)
- fullautomaintweekradio.setSelected(True)
- fullyautomaintenancelabel1.setEnabled(True)
- fullyautomaintenancelabel2.setEnabled(True)
- if fullautofreq == "month":
- fullautomaintcacheradio.setEnabled(True)
- fullautomaintenanceradio.setSelected(True)
- fullautomaintmonthradio.setEnabled(True)
- fullautomaintpackagesradio.setEnabled(True)
- fullautomaintquarterradio.setEnabled(True)
- fullautomaintthumbradio.setEnabled(True)
- fullautomaintweekradio.setEnabled(True)
- fullautomaintmonthradio.setSelected(True)
- fullyautomaintenancelabel1.setEnabled(True)
- fullyautomaintenancelabel2.setEnabled(True)
- if fullautofreq == "quarter":
- fullautomaintcacheradio.setEnabled(True)
- fullautomaintenanceradio.setSelected(True)
- fullautomaintmonthradio.setEnabled(True)
- fullautomaintpackagesradio.setEnabled(True)
- fullautomaintquarterradio.setEnabled(True)
- fullautomaintthumbradio.setEnabled(True)
- fullautomaintweekradio.setEnabled(True)
- fullautomaintquarterradio.setSelected(True)
- fullyautomaintenancelabel1.setEnabled(True)
- fullyautomaintenancelabel2.setEnabled(True)
- fullautothumb = config['fullautothumb']
- if fullautothumb == "yes":
- fullautomaintthumbradio.setSelected(True)
- fullautocache = config['fullautocache']
- if fullautocache == "yes":
- fullautomaintcacheradio.setSelected(True)
- fullautopackages = config['fullautopackages']
- if fullautopackages == "yes":
- fullautomaintpackagesradio.setSelected(True)
- cacheinclude_genesis_setting = config['cacheinclude_genesis']
- if cacheinclude_genesis_setting == "yes":
- cacheinclude_genesis.setSelected(True)
- cacheinclude_navix_setting = config['cacheinclude_navix']
- if cacheinclude_navix_setting == "yes":
- cacheinclude_navix.setSelected(True)
- cacheinclude_youtube_setting = config['cacheinclude_youtube']
- if cacheinclude_youtube_setting == "yes":
- cacheinclude_youtube.setSelected(True)
- cacheinclude_ivue_setting = config['cacheinclude_ivue']
- if cacheinclude_ivue_setting == "yes":
- cacheinclude_ivue.setSelected(True)
- cacheinclude_salts_setting = config['cacheinclude_salts']
- if cacheinclude_salts_setting == "yes":
- cacheinclude_salts.setSelected(True)
- cacheinclude_pulsar_setting = config['cacheinclude_pulsar']
- if cacheinclude_pulsar_setting == "yes":
- cacheinclude_pulsar.setSelected(True)
- except:
- pass
- get_size(thumbnailpath)
- thumbnailfiles = total_files
- thumbnailsize = total_size/1024/1024
- gettempandcache()
- get_size(packagespath)
- packagesfiles = total_files
- packagessize = total_size/1024/1024
- packagessize = int(packagessize)
- if packagessize == 0 and packagesfiles > 0:
- packagessize = "<1"
- if thumbnailsize == 0 and thumbnailfiles > 0:
- thumbnailsize = "<1"
- maint_cache_label5.setLabel('[COLOR=lightgray]' + str(tempandcachefiles) + '[/COLOR]')
- maint_cache_label6.setLabel('[COLOR=lightgray]' + str(tempandcachesize) + ' MB[/COLOR]')
- maint_packages_label4.setLabel('[COLOR=lightgray]' + str(packagesfiles) + '[/COLOR]')
- maint_packages_label5.setLabel('[COLOR=lightgray]' + str(packagessize) + ' MB[/COLOR]')
- maint_thumb_label4.setLabel('[COLOR=lightgray]' + str(thumbnailfiles) + '[/COLOR]')
- maint_thumb_label5.setLabel('[COLOR=lightgray]' + str(thumbnailsize) + ' MB[/COLOR]')
- if packagessize >= 180:
- maint_packages_red.setVisible(True)
- recommendedaction = "Clear packages"
- if packagessize >= 70 and packagessize < 180:
- maint_packages_amber.setVisible(True)
- if packagessize < 70:
- maint_packages_green.setVisible(True)
- if packagessize == "<1":
- maint_packages_red.setVisible(False)
- maint_packages_green.setVisible(True)
- if thumbnailsize >= 2000:
- maint_thumb_red.setVisible(True)
- recommendedaction = "Clear thumbnails"
- if thumbnailsize >= 1000 and thumbnailsize < 2000:
- maint_thumb_amber.setVisible(True)
- if thumbnailsize < 1000:
- maint_thumb_green.setVisible(True)
- if thumbnailsize == "<1":
- maint_thumb_red.setVisible(False)
- maint_thumb_green.setVisible(True)
- if tempandcachesize >= 500:
- maint_cache_red.setVisible(True)
- recommendedaction = "Clear cache\\temp"
- if tempandcachesize >= 200 and tempandcachesize < 500:
- maint_cache_amber.setVisible(True)
- if tempandcachesize < 200:
- maint_cache_green.setVisible(True)
- if tempandcachesize == "<1":
- maint_cache_green.setVisible(True)
- maint_cache_red.setVisible(False)
- # if userlevel == "staff" or userlevel == "admin":
- # maintenancelist.controlUp(maintenancebutton)
- def tweaks():
- hidecontrols()
- tweakslist.reset()
- tweakslist.addItem('[COLOR=goldenrod]Advanced Settings Wizard[/COLOR]')
- #tweakslist.addItem('[COLOR=darkturquoise]Genesis (v4): Show 100 items per page[/COLOR]')
- tweakslist.addItem('[COLOR=goldenrod]IceFilms: Blocked URL fix[/COLOR]')
- tweakslist.addItem('[COLOR=goldenrod]Primewire\\1Channel: Blocked URL fix[/COLOR]')
- tweakslist.setVisible(True)
- maintenancebutton.controlDown(tweakslist)
- tweakslist.controlUp(tweaksbutton)
- browseaddonsbutton.controlDown(tweakslist)
- browsebuildsbutton.controlDown(tweakslist)
- backupbutton.controlDown(tweakslist)
- #maintenancebutton.controlDown(deletepackagesbutton)
- tweaksbutton.controlDown(tweakslist)
- morebutton.controlDown(tweakslist)
- settingsbutton.controlDown(tweakslist)
- # if userlevel == "staff" or userlevel == "admin":
- # tweakslist.controlUp(maintenancebutton)
- def more():
- hidecontrols()
- morelist.reset()
- morelist.addItem('[COLOR=goldenrod]System Information[/COLOR]')
- morelist.addItem('[COLOR=goldenrod]Upload Kodi Log[/COLOR]')
- morelist.addItem('[COLOR=goldenrod]Internet Speed Test[/COLOR]')
- morelist.addItem('[COLOR=goldenrod]Erase all Data/Fresh Start[/COLOR]')
- morelist.addItem('[COLOR=goldenrod]Force Close Kodi[/COLOR]')
- # morelist.addItem('[COLOR=goldenrod]Install PVR \ M3U \'Wizard\'?[/COLOR]')
- morelist.addItem('[COLOR=goldenrod]Suggestions welcome..[/COLOR]')
- morelist.setVisible(True)
- maintenancebutton.controlDown(morelist)
- morelist.controlUp(morebutton)
- browseaddonsbutton.controlDown(morelist)
- browsebuildsbutton.controlDown(morelist)
- backupbutton.controlDown(morelist)
- #maintenancebutton.controlDown(deletepackagesbutton)
- tweaksbutton.controlDown(morelist)
- morebutton.controlDown(morelist)
- settingsbutton.controlDown(morelist)
- def systeminfo():
- xbmc.executebuiltin( "ActivateWindow(busydialog)" )
- global ip
- global isp
- global country
- global city
- hidecontrols()
- global cpufreq
- cpufreq = xbmc.getInfoLabel('System.CpuFrequency')
- while cpufreq == "Busy":
- cpufreq = xbmc.getInfoLabel('System.CpuFrequency')
- global gpu
- gpu = xbmc.getInfoLabel('System.VideoEncoderInfo')
- while gpu == "Busy":
- gpu = xbmc.getInfoLabel('System.VideoEncoderInfo')
- global kernel
- kernel = xbmc.getInfoLabel('System.KernelVersion')
- while kernel == "Busy":
- kernel = xbmc.getInfoLabel('System.KernelVersion')
- global mac
- mac = xbmc.getInfoLabel('Network.MacAddress')
- while mac == "Busy":
- mac = xbmc.getInfoLabel('Network.MacAddress')
- internetstate = xbmc.getInfoLabel('System.InternetState')
- while internetstate == "Busy":
- internetstate = xbmc.getInfoLabel('System.InternetState')
- try:
- url = 'http://whatismyipaddress.com/'
- req = urllib2.Request(url)
- req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
- try:
- response = urllib2.urlopen(req)
- except urllib2.URLError, e:
- pass
- # print '@ares: URL Timeout: whatismyipaddress.com'
- link=response.read()
- response.close()
- global ip
- ip = regex_from_to(link, '26px;text-decoration:none;">', '</a>')
- global city
- city = regex_from_to(link, 'City:</th><td style="font-size:14px;">', '</td>')
- global country
- country = regex_from_to(link, 'Country:</th><td style="font-size:14px;">', '</td>')
- global isp
- isp = regex_from_to(link, 'ISP:</th><td style="font-size:14px;">', '</td>')
- if debuglog == "true":
- print '@ares: using http://whatismyipaddress.com to collect info'
- print ' '
- print '@ares: ip = ' + ip
- print '@ares: city = ' + city
- print '@ares: country = ' + country
- print '@ares: isp = ' + isp
- except:
- pass
- if ip == "":
- if debuglog == "true":
- print ' '
- print '@ares: ip mismatch - using backup site to collect data...'
- print ' '
- url = 'https://www.privateinternetaccess.com/pages/whats-my-ip/'
- req = urllib2.Request(url)
- req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
- try:
- response = urllib2.urlopen(req)
- except urllib2.URLError, e:
- pass
- # print '@ares: URL Timeout: privateinternetaccess.com'
- link=response.read()
- response.close()
- #global ip
- ip = regex_from_to(link, 'IP Address:<span style="font-weight:bold"> ', '</span>')
- #global city
- city = regex_from_to(link, 'City</span>:<span style="font-weight:bold"> ', '</span>')
- if city.find('span') <> -1:
- city = " "
- #global country
- country = regex_from_to(link, 'Country:<span style="font-weight:bold"> ', '</span>')
- if country.find('span') <> -1:
- country = " "
- #global isp
- isp = regex_from_to(link, 'Internet Service Provider:<span style="font-weight:bold"> ', '</span>')
- if isp.find('span') <> -1:
- isp = " "
- if debuglog == "true":
- print '@ares: using https://www.privateinternetaccess.com/pages/whats-my-ip/ to collect info'
- print ' '
- print '@ares: ip = ' + ip
- print '@ares: city = ' + city
- print '@ares: country = ' + country
- print '@ares: isp = ' + isp
- cpufreqlabel.setLabel('[COLOR=lightgray]' + cpufreq + '[/COLOR]')
- gpulabel.setLabel('[COLOR=lightgray]' + gpu + '[/COLOR]')
- externaliplabel.setLabel('[COLOR=lightgray]' + ip + '[/COLOR]')
- isplabel.setLabel('[COLOR=lightgray]' + isp + '[/COLOR]')
- countrylabel.setLabel('[COLOR=lightgray]' + country + '[/COLOR]')
- citylabel.setLabel('[COLOR=lightgray]' + city + '[/COLOR]')
- kernellabel.setLabel('[COLOR=lightgray]' + kernel + '[/COLOR]')
- macaddresslabel.setLabel('[COLOR=lightgray]' + mac + '[/COLOR]')
- internetstatelabel.setLabel('[COLOR=lightgray]' + internetstate + '[/COLOR]')
- kerneltextlabel.setVisible(True)
- kernellabel.setVisible(True)
- cpufreqtextlabel.setVisible(True)
- cpufreqlabel.setVisible(True)
- gputextlabel.setVisible(True)
- gpulabel.setVisible(True)
- kodiversiontextlabel.setVisible(True)
- kodiversionlabel.setVisible(True)
- kodibuildtextlabel.setVisible(True)
- kodibuildlabel.setVisible(True)
- screenmodetextlabel.setVisible(True)
- screenmodelabel.setVisible(True)
- networkstatetextlabel.setVisible(True)
- networkstatelabel.setVisible(True)
- internaliptextlabel.setVisible(True)
- internaliplabel.setVisible(True)
- macaddresstextlabel.setVisible(True)
- macaddresslabel.setVisible(True)
- gatewaytextlabel.setVisible(True)
- gatewaylabel.setVisible(True)
- dnstextlabel.setVisible(True)
- dnslabel.setVisible(True)
- interetstatetextlabel.setVisible(True)
- internetstatelabel.setVisible(True)
- cputemptextlabel.setVisible(True)
- cputemplabel.setVisible(True)
- cpuuseagetextlabel.setVisible(True)
- cpuusagelabel.setVisible(True)
- freestoragetextlabel.setVisible(True)
- freestoragelabel.setVisible(True)
- usedstoragetextlabel.setVisible(True)
- usedstoragelabel.setVisible(True)
- totalstoragetextlabel.setVisible(True)
- totalstoragelabel.setVisible(True)
- freeramtextlabel.setVisible(True)
- freeramlabel.setVisible(True)
- externaliptextlabel.setVisible(True)
- externaliplabel.setVisible(True)
- isptextlabel.setVisible(True)
- isplabel.setVisible(True)
- countrytextlabel.setVisible(True)
- countrylabel.setVisible(True)
- citytextlabel.setVisible(True)
- citylabel.setVisible(True)
- # if userlevel == "staff" or userlevel == "admin":
- # browsebuildsbutton.controlDown(managebuildsbutton)
- # browseaddonsbutton.controlDown(manageaddonsbutton)
- # browserepobutton.controlDown(managereposbutton)
- # maintenancebutton.controlDown(manageusersbutton)
- # tweaksbutton.controlDown(blankbutton1)
- # morebutton.controlDown(blankbutton2)
- # settingsbutton.controlDown(blankbutton2)
- xbmc.executebuiltin( "Dialog.Close(busydialog)" )
- def installbuild():
- global url
- global addonpath
- global addontype
- global addonname
- global name
- global username
- global currentlist
- if currentlist == "blackbox":
- blackbox2()
- else:
- buildresult = getbuilddetails()
- def installbutton():
- global url
- global addonpath
- global addontype
- global addonname
- global name
- global username
- global repolistraw
- #print 'currentlist>> ' + currentlist
- if currentlist == 'videoaddon':
- getaddondetails()
- manageaddon.installaddon(addonname,url,addonpath, addontype, deviceid, mac, username)
- showvideoaddonslist()
- if repopath == "":
- pass
- else:
- desinationrepofolder = translate(os.path.join('special://home/addons', repopath))
- desinationrepoxml = os.path.join(desinationrepofolder, 'addon.xml')
- if not os.path.isfile(desinationrepoxml):
- dialog = xbmcgui.Dialog()
- if dialog.yesno(strings.getstring("installrepo"), strings.getstring("installrepo2")):
- try:
- repolistraw
- except:
- url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getreposincadult&time=' + datetime.datetime.now().strftime('%S')
- req = urllib2.Request(url)
- req.add_header('User-Agent', aresagent)
- response = urllib2.urlopen(req)
- repolistraw = response.read()
- url2 = ""
- data = json.loads(repolistraw)
- for entry in data:
- if entry['repopath'] == repopath:
- url2 = entry['url']
- addonname = entry['name']
- addontype = "repo"
- if debuglog == "true":
- print addonname
- print repopath
- print addontype
- print '--> URL: '+ url2
- if url2 == "":
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("repounavailable"), "","")
- else:
- manageaddon.installaddon(addonname,url2,repopath, addontype, deviceid, mac, username)
- if currentlist == 'programaddon':
- getaddondetails()
- manageaddon.installaddon(addonname,url,addonpath, addontype, deviceid, mac, username)
- showprogramaddonslist()
- if currentlist == 'repo':
- getrepodetails()
- manageaddon.installaddon(name, url, addonpath, addontype, deviceid, mac, username)
- showrepolist()
- # dialog = xbmcgui.Dialog()
- # dialog.ok(name, "URL: " + url + "\n" + "Iconimage: " + iconimage + "\n" + "Descr: " + descr + "\n" + "Fanart: " + fanart, "", "")
- def uninstallbutton():
- #print 'currentlist>> ' + currentlist
- if currentlist == 'build':
- getbuilddetails()
- if currentlist == 'videoaddon':
- getaddondetails()
- manageaddon.uninstalladdon(addonname,addonpath, addontype)
- showvideoaddonslist()
- if currentlist == 'repo':
- getrepodetails()
- def tweakcache_page1():
- tweakcachelabel1.setVisible(False)
- tweakcache_page1button.setVisible(False)
- tweakcachelabel2.setVisible(True)
- tweakcachelabel3.setVisible(True)
- global freeramlabel3
- global freeramdev3
- global freeramdev3min10pc
- tweakcache_page2button.setVisible(True)
- freeramlabel = xbmc.getInfoLabel('System.FreeMemory')
- global freeramlabel3
- freeramlabel2 = freeramlabel[:-2]
- freeramlabel3 = int(freeramlabel2)
- global freeramdev3
- freeramdev3 = int((freeramlabel3/3))
- freeramstring = str(freeramdev3)
- freeramdev3min10pc = int((freeramdev3 * .90))
- freeramdev3float = float(freeramlabel3/3)
- if freeramdev3min10pc > 500:
- freeramdev3min10pc = 500
- percentage = float(freeramdev3min10pc/freeramdev3float * 100)
- slider1.setPercent(percentage)
- global freerambytes
- freerambytes = freeramdev3*1024*1024
- global freerambytesstring
- freerambytesstring = str(freerambytes)
- cachetweak_1stline.setLabel('[COLOR=darkgray]' + strings.getstring("cachetweak1") + freeramlabel + strings.getstring("cachetweak2") +'[/COLOR]')
- cachetweak_1stline.setVisible(True)
- cachetweak_2ndline.setLabel('[COLOR=lightgray]' + strings.getstring("cachetweak3") + freeramstring + strings.getstring("cachetweak4") + '[/COLOR]')
- cachetweak_2ndline.setVisible(True)
- tweakcachelabel2.setLabel('[COLOR=darkgray]' + strings.getstring("tweakcachelabel2") + str(freeramdev3min10pc) + 'MB [/COLOR]')
- tweakslist.controlRight(tweakcache_page2button)
- tweakcache_page2button.controlLeft(tweakslist)
- tweakcache_page2button.controlUp(tweaksbutton)
- tweakcache_page2button.setVisible(True)
- window.setFocus(tweakcache_page2button)
- def tweakcache_page2():
- global newbuffermode
- global newcache
- global newrbf
- global newcurl
- tweakcache_page2button.setVisible(False)
- cachetweak_1stline.setVisible(False)
- cachetweak_2ndline.setVisible(False)
- tweakcachelabel2.setVisible(False)
- tweakcachelabel3.setVisible(False)
- slider1value.setVisible(True)
- slider1.setVisible(True)
- slider1value.setLabel('[COLOR=darkgray] ' + str(freeramdev3min10pc) + 'MB[/COLOR]')
- slider2value.setLabel('[COLOR=darkgray] 10s[/COLOR]')
- slider3value.setLabel('[COLOR=darkgray] 5[/COLOR]')
- recommendedramsetting.setLabel('[COLOR=darkgray]' + strings.getstring("recommendedsetting") + str(freeramdev3min10pc) + 'MB[/COLOR]')
- tweakcache_page2intro.setVisible(True)
- currentramsetting.setVisible(True)
- recommendedramsetting.setVisible(True)
- videcachesizelabel.setVisible(True)
- applycachetweakbutton.setVisible(True)
- slider2.setVisible(True)
- curltimelabel.setVisible(True)
- currentcurlsetting.setVisible(True)
- slider2value.setVisible(True)
- recommendedcurlsetting.setVisible(True)
- slider3.setVisible(True)
- readbufferfactorlabel.setVisible(True)
- currentrbfsetting.setVisible(True)
- slider3value.setVisible(True)
- recommendedrbfsetting.setVisible(True)
- applycachetweakbutton.controlUp(mode2radiobutton)
- slider3.controlUp(slider2)
- slider3.controlDown(mode2radiobutton)
- slider2.controlUp(slider1)
- slider2.controlDown(slider3)
- slider1.controlUp(tweaksbutton)
- slider1.controlDown(slider2)
- tweaksbutton.controlDown(slider1)
- buffermodelabel.setVisible(True)
- mode1radiobutton.setVisible(True)
- mode2radiobutton.setVisible(True)
- mode3radiobutton.setVisible(True)
- mode4radiobutton.setVisible(True)
- mode2radiobutton.setSelected(True)
- newbuffermode = 2
- #newcache = freeramdev3
- newcurl = 10
- newrbf = 5
- if freeramdev3 < 500:
- newcache = freeramdev3
- else:
- newcache = freeramdev3min10pc
- mode1radiobutton.controlUp(slider3)
- mode2radiobutton.controlUp(slider3)
- mode3radiobutton.controlUp(slider3)
- mode4radiobutton.controlUp(slider3)
- mode1radiobutton.controlDown(applycachetweakbutton)
- mode2radiobutton.controlDown(applycachetweakbutton)
- mode3radiobutton.controlDown(applycachetweakbutton)
- mode4radiobutton.controlDown(applycachetweakbutton)
- mode1radiobutton.controlRight(mode2radiobutton)
- mode2radiobutton.controlLeft(mode1radiobutton)
- mode2radiobutton.controlRight(mode3radiobutton)
- mode3radiobutton.controlLeft(mode2radiobutton)
- mode3radiobutton.controlRight(mode4radiobutton)
- mode4radiobutton.controlLeft(mode3radiobutton)
- window.setFocus(applycachetweakbutton)
- def replace_words(text, word_dic):
- """
- take a text and replace words that match a key in a dictionary with
- the associated value, return the changed text
- """
- rc = re.compile('|'.join(map(re.escape, word_dic)))
- def translate(match):
- return word_dic[match.group(0)]
- return rc.sub(translate, text)
- def applycachetweak(newcache, newcurl, newrbf, newbuffermode):
- # try:
- #print newcache
- cacheout = str(newcache*1024*1024)
- str3 = '<advancedsettings>\n <network>\n <buffermode>' + str(newbuffermode) + '</buffermode>\n <cachemembuffersize>' + str(cacheout) + '</cachemembuffersize>\n <readbufferfactor>' + str(newrbf) + '</readbufferfactor>\n <curlclienttimeout>' + str(newcurl) + '</curlclienttimeout>\n <curllowspeedtime>' + str(newcurl) + '</curllowspeedtime>\n </network>\n</advancedsettings>'
- fout = open(advancedxmlfile, "w")
- fout.write(str3)
- fout.close()
- # except:
- # dialog = xbmcgui.Dialog()
- # dialog.ok("Error", "Could not write to xml file", "","")
- # return()
- dialog = xbmcgui.Dialog()
- dialog.ok("Completed", strings.getstring('advancedsettings'), "","")
- def deletepackages():
- maintenance.deletepackages()
- get_size(packagespath)
- packagesfiles = total_files
- packagessize = total_size/1024/1024
- maint_packages_label4.setLabel('[COLOR=lightgray]' + str(packagesfiles) + '[/COLOR]')
- maint_packages_label5.setLabel('[COLOR=lightgray]' + str(packagessize) + ' MB[/COLOR]')
- try:
- with open(settingsfile, 'r',0) as f:
- config = json.load(f)
- maint_totallocalfileslabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalfilesdeleted") + '[/COLOR]')
- totalfilesdeleted = config['totaltempfiles']
- oldlabel = maint_totallocalfileslabel.getLabel()
- maint_totallocalfileslabel.setLabel(oldlabel + '[COLOR=darkgray]' + totalfilesdeleted + '[/COLOR]')
- maint_totallocalspacelabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalspacegained") + '[/COLOR]')
- totalspacegained = config['totalspacegained']
- totalspacegained2 = int(round(float(totalspacegained)))
- oldlabel = maint_totallocalspacelabel.getLabel()
- maint_totallocalspacelabel.setLabel(oldlabel + '[COLOR=darkgray]' + str(totalspacegained2) + ' MB[/COLOR]')
- except:
- pass
- def deletecache():
- maintenance.deletecache()
- gettempandcache()
- maint_cache_label5.setLabel('[COLOR=lightgray]' + str(tempandcachefiles) + '[/COLOR]')
- maint_cache_label6.setLabel('[COLOR=lightgray]' + str(tempandcachesize) + ' MB[/COLOR]')
- try:
- with open(settingsfile, 'r',0) as f:
- config = json.load(f)
- maint_totallocalfileslabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalfilesdeleted") + '[/COLOR]')
- totalfilesdeleted = config['totaltempfiles']
- oldlabel = maint_totallocalfileslabel.getLabel()
- maint_totallocalfileslabel.setLabel(oldlabel + '[COLOR=darkgray]' + totalfilesdeleted + '[/COLOR]')
- maint_totallocalspacelabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalspacegained") + '[/COLOR]')
- totalspacegained = config['totalspacegained']
- totalspacegained2 = int(round(float(totalspacegained)))
- oldlabel = maint_totallocalspacelabel.getLabel()
- maint_totallocalspacelabel.setLabel(oldlabel + '[COLOR=darkgray]' + str(totalspacegained2) + ' MB[/COLOR]')
- except:
- pass
- def deletethumbnails():
- maintenance.deletethumbnails()
- get_size(thumbnailpath)
- thumbnailfiles = total_files
- thumbnailsize = total_size/1024/1024
- maint_thumb_label4.setLabel('[COLOR=lightgray]' + str(thumbnailfiles) + '[/COLOR]')
- maint_thumb_label5.setLabel('[COLOR=lightgray]' + str(thumbnailsize) + ' MB[/COLOR]')
- try:
- with open(settingsfile, 'r',0) as f:
- config = json.load(f)
- maint_totallocalfileslabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalfilesdeleted") + '[/COLOR]')
- totalfilesdeleted = config['totaltempfiles']
- oldlabel = maint_totallocalfileslabel.getLabel()
- maint_totallocalfileslabel.setLabel(oldlabel + '[COLOR=darkgray]' + totalfilesdeleted + '[/COLOR]')
- maint_totallocalspacelabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalspacegained") + '[/COLOR]')
- totalspacegained = config['totalspacegained']
- totalspacegained2 = int(round(float(totalspacegained)))
- oldlabel = maint_totallocalspacelabel.getLabel()
- maint_totallocalspacelabel.setLabel(oldlabel + '[COLOR=darkgray]' + str(totalspacegained2) + ' MB[/COLOR]')
- except:
- pass
- def logout():
- addon.setSetting("username", "")
- # addon.setSetting("email", "")
- addon.setSetting("accountstatus", "")
- addon.setSetting("Subends", "")
- addon.setSetting("activationsleft", "")
- logoutbutton.setVisible(False)
- loginbutton.setVisible(True)
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring('areswizard'), strings.getstring('restarneeded'), "","")
- def login():
- global password
- global username
- global email
- global userinfo
- global userlevel
- try:
- with open(settingsfile, 'r',0) as f:
- config = json.load(f)
- deviceid = config['deviceid']
- except:
- deviceid = "Error"
- dialog = xbmcgui.Dialog()
- if dialog.yesno(strings.getstring('areswizard'), strings.getstring('alreadyhaveaccount')):
- # YES
- keyboard = xbmc.Keyboard("", strings.getstring('enteremail'))
- keyboard.doModal()
- emailinput = keyboard.getText()
- keyboard = xbmc.Keyboard("", strings.getstring('entername'))
- keyboard.doModal()
- nameinput = keyboard.getText()
- keyboard = xbmc.Keyboard("", strings.getstring('enterpass'))
- keyboard.setHiddenInput(True)
- keyboard.doModal()
- passwordinput = keyboard.getText()
- addon.setSetting("deviceid", deviceid)
- addon.setSetting("username", nameinput)
- # addon.setSetting("email", emailinput)
- configraw = update.loginbutton(nameinput, passwordinput, emailinput, deviceid, mac)
- if configraw == "registered":
- loginstatus = update.login(nameinput, mac, deviceid)
- if loginstatus == "loginerror":
- addon.setSetting("accountstatus", "free")
- elif loginstatus == "devicemac-mismatch":
- length=10
- deviceid = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(length))
- config = {'deviceid': deviceid}
- if not os.path.exists(datapath):
- os.makedirs(datapath)
- with open(settingsfile, 'w') as f:
- json.dump(config, f)
- f.close
- addon.setSetting("deviceid", deviceid)
- addon.setSetting("activationsleft", '')
- addon.setSetting("Subends", '')
- addon.setSetting("username", "free")
- addon.setSetting("accountstatus", "free")
- loginstatus = update.login('free' , mac, deviceid)
- elif loginstatus == "inserted":
- addon.setSetting("username", "free")
- addon.setSetting("accountstatus", "free")
- accountstatus = "free"
- username = "free"
- userlevel = "free"
- addon.setSetting("activationsleft", '')
- addon.setSetting("Subends", '')
- elif loginstatus == "user-not-found":
- addon.setSetting("username", "free")
- addon.setSetting("accountstatus", "free")
- accountstatus = "free"
- username = "free"
- userlevel = "free"
- addon.setSetting("activationsleft", '')
- addon.setSetting("Subends", '')
- else:
- data = json.loads(loginstatus)
- #print(data)
- for entry in data:
- if username <> "free":
- Subends = entry['Subends']
- userlevel = entry['userlevel']
- Banned = entry['Banned']
- BanReason = entry['BanReason']
- loginbutton.setVisible(False)
- logoutbutton.setVisible(True)
- browsebuildsbutton.controlUp(logoutbutton)
- logoutbutton.controlDown(browsebuildsbutton)
- window.setFocus(browsebuildsbutton)
- if configraw == "user-or-pass-not-found":
- dialog = xbmcgui.Dialog()
- dialog.ok("Ares Wizard", "Username or Password Incorrect", "","")
- addon.setSetting("username", "free")
- addon.setSetting("accountstatus", "free")
- accountstatus = "free"
- username = "free"
- userlevel = "free"
- addon.setSetting("activationsleft", '')
- addon.setSetting("Subends", '')
- if configraw == "maximumnumberofregistrationsmet":
- dialog = xbmcgui.Dialog()
- dialog.ok("Ares Wizard", "You cannot register anymore devices using this email", "","")
- addon.setSetting("username", "free")
- addon.setSetting("accountstatus", "free")
- accountstatus = "free"
- username = "free"
- userlevel = "free"
- addon.setSetting("activationsleft", '')
- addon.setSetting("Subends", '')
- else:
- # NO
- # registrationprocess = user.register(mac, deviceid)
- dialog = xbmcgui.Dialog()
- dialog.ok("Ares Wizard", "This is currently for staff use only", "","")
- def activate():
- global mac
- try:
- mac
- except:
- getsysinfo()
- try:
- username = xbmcplugin.getSetting(int(sys.argv[1]), 'username')
- except:
- pass
- registrationprocess = user.activate(username, mac, deviceid)
- if registrationprocess == "activated":
- browsebuildsbutton.setEnabled(True)
- browseaddonsbutton.setEnabled(True)
- backupbutton.setEnabled(True)
- maintenancebutton.setEnabled(True)
- tweaksbutton.setEnabled(True)
- morebutton.setEnabled(True)
- activatebutton.setVisible(False)
- logoutbutton.setVisible(True)
- window.setFocus(browsebuildsbutton)
- addon.setSetting("accountstatus", "Registered")
- introlabel.setLabel('[COLOR=darkgray]' + strings.getstring('introlabel_loggedin') + '[/COLOR]')
- update.login(username, mac, deviceid)
- def showrating(rating, votesint):
- star1.setVisible(False)
- star2.setVisible(False)
- star3.setVisible(False)
- star4.setVisible(False)
- star5.setVisible(False)
- # print 'rating = ' + str(rating)
- # print 'votes = ' + str(votesint)
- ratingint = int(rating)
- votes = int(votesint)
- if ratingint == 0 or votes == 0:
- return
- averageratingraw = (ratingint/votes)
- averagerating2 = int(averageratingraw)
- averagerating = str(averagerating2)
- # print 'averagerating = ' + str(averagerating)
- if averagerating == "5":
- star1.setVisible(True)
- star2.setVisible(True)
- star3.setVisible(True)
- star4.setVisible(True)
- star5.setVisible(True)
- elif averagerating == "4":
- star1.setVisible(True)
- star2.setVisible(True)
- star3.setVisible(True)
- star4.setVisible(True)
- elif averagerating == "3":
- star1.setVisible(True)
- star2.setVisible(True)
- star3.setVisible(True)
- elif averagerating == "2":
- star1.setVisible(True)
- star2.setVisible(True)
- elif averagerating == "1":
- star1.setVisible(True)
- else:
- pass
- def getunblockurl(name):
- global unblockurls
- try:
- unblockurls
- except:
- url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getunblockurls&time=' + datetime.datetime.now().strftime('%S')
- url = url.replace (" ", "%20")
- req = urllib2.Request(url)
- req.add_header('User-Agent', aresagent)
- response = urllib2.urlopen(req)
- unblockurls=response.read()
- response.close()
- data = json.loads(unblockurls)
- for entry in data:
- if name == entry['name']:
- link = entry['url']
- return(link)
- def changeurl():
- destaddonpath = os.path.join(xbmc.translatePath('special://home/userdata/addon_data/'), addonpath)
- destxmlfile = os.path.join(destaddonpath, 'settings.xml')
- s=open(destxmlfile).read()
- if currenturl in s:
- s=s.replace(currenturl, unblockurl)
- f=open(destxmlfile, 'w')
- f.write(s)
- f.flush()
- f.close()
- if unblockurl in open(destxmlfile).read():
- dialog = xbmcgui.Dialog()
- dialog.ok("Success", name + strings.getstring("urlchanged"), "","")
- else:
- dialog = xbmcgui.Dialog()
- dialog.ok("Error", name + strings.getstring("urlnotchanged"), "","")
- def librmtp():
- if xbmc.getCondVisibility('system.platform.osx'):
- try: os.system('killall -9 XBMC')
- except: pass
- try: os.system('killall -9 Kodi')
- except: pass
- elif xbmc.getCondVisibility('system.platform.linux'):
- try: os.system('killall XBMC')
- except: pass
- try: os.system('killall Kodi')
- except: pass
- try: os.system('killall -9 xbmc.bin')
- except: pass
- try: os.system('killall -9 kodi.bin')
- except: pass
- elif xbmc.getCondVisibility('system.platform.android'):
- try: os.system('adb shell am force-stop org.xbmc.kodi')
- except: pass
- try: os.system('adb shell am force-stop org.kodi')
- except: pass
- try: os.system('adb shell am force-stop org.xbmc.xbmc')
- except: pass
- try: os.system('adb shell am force-stop org.xbmc')
- except: pass
- elif xbmc.getCondVisibility('system.platform.windows'):
- print ' '
- print 'windows detected'
- print ' '
- #default = 383609
- libfile = translate(os.path.join('special://xbmc/system/players/dvdplayer/','librtmp.dll'))
- print 'libfile: ' + libfile
- filesize = os.path.getsize(libfile)
- print ' '
- print 'filesize: ' + str(filesize)
- if filesize == 383609:
- dialog = xbmcgui.Dialog()
- if dialog.yesno("Backup ?", "You have the default librmtp, do you want to back it up?"):
- try:
- os.system('copy "C:\Program Files (x86)\Kodi\system\players\dvdplayer\librtmp.dll" "C:\Program Files (x86)\Kodi\system\players\dvdplayer\librtmp_backup.dll"')
- except:
- pass
- else: #ATV
- try: os.system('killall AppleTV') # appletv
- except: pass
- try: os.system('sudo initctl stop kodi') #osmc/raspxbmc
- except: pass
- try: os.system('sudo initctl stop xbmc')
- except: pass
- def freshstart():
- freshstartprompt = xbmcgui.Dialog().yesno(strings.getstring("areswizard"), strings.getstring("buildinstallfreshstart1"), '', strings.getstring("buildinstallfreshstart2"), yeslabel='Yes',nolabel='No')
- if freshstartprompt == 1:
- manageaddon.freshstart()
- if debuglog == "true":
- print '----------------------------------'
- print '--> kodi still running <--'
- print '-----------------------------------'
- xbmc.executebuiltin("ReloadSkin()")
- def repairbuild():
- global name
- result = manageaddon.restorebuild(name)
- if result == "kodirunning":
- if xbmc.getCondVisibility('system.platform.android'):
- hidecontrols()
- # buildinstallpng
- backimage.setImage(buildinstallpng)
- loginbutton.setEnabled(False)
- browsebuildsbutton.setEnabled(False)
- browseaddonsbutton.setEnabled(False)
- backupbutton.setEnabled(False)
- maintenancebutton.setEnabled(False)
- tweaksbutton.setEnabled(False)
- morebutton.setEnabled(False)
- settingsbutton.setEnabled(False)
- closebutton.setEnabled(False)
- else:
- dialog = xbmcgui.Dialog()
- dialog.ok(strings.getstring("areswizard"), strings.getstring("kodinotclosed"))
- def close():
- window.close()
- def bakcupbuttonpush():
- hidecontrols()
- dialog = xbmcgui.Dialog()
- dialog.ok("Ares Wizard", "Sorry, backup feature isn't ready yet", "","")
- backimage = pyxbmct.Image(os.path.join(images_path, 'back.png'))
- window.placeControl(backimage, -50, -2, 655, 178)
- #################### S L I d e R S ########################################################################################################################
- # Slider value label
- SLIDER1_INIT_VALUE = 90
- # Slider
- global slider1
- slider1 = pyxbmct.Slider(textureback=slidertexture)
- window.placeControl(slider1, 180, 90, 25, 60)
- slider1.setPercent(SLIDER1_INIT_VALUE)
- slider1.setVisible(False)
- #Connect key and mouse events for slider update feedback.
- window.connectEventList([pyxbmct.ACTION_MOVE_LEFT,
- pyxbmct.ACTION_MOVE_RIGHT,
- pyxbmct.ACTION_MOUSE_DRAG,
- pyxbmct.ACTION_MOUSE_LEFT_CLICK],
- list_update)
- tweakcache_page2intro = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("cachetweakfloowingsettings") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(tweakcache_page2intro, 80, 70, 60, 100)
- tweakcache_page2intro.setVisible(False)
- videcachesizelabel = pyxbmct.Label('[COLOR=lightgray]' + strings.getstring("videocachesize") + '[/COLOR]', 'font14')
- window.placeControl(videcachesizelabel, 148, 106, 10, 30)
- videcachesizelabel.setVisible(False)
- currentramsetting = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("currentsetting") + '[/COLOR]')
- window.placeControl(currentramsetting, 195, 87, 10, 30)
- currentramsetting.setVisible(False)
- global slider1value
- slider1value = pyxbmct.Label(str(SLIDER1_INIT_VALUE), alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(slider1value, 214, 107)
- slider1value.setVisible(False)
- recommendedramsetting = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("recommendedsetting") + '[/COLOR]')
- window.placeControl(recommendedramsetting, 195, 123, 10, 35)
- recommendedramsetting.setVisible(False)
- ##### slider 2
- # Slider value label
- SLIDER2_INIT_VALUE = 50
- # Slider
- global slider2
- slider2 = pyxbmct.Slider(textureback=slidertexture)
- window.placeControl(slider2, 270, 90, 25, 60)
- slider2.setPercent(SLIDER2_INIT_VALUE)
- slider2.setVisible(False)
- #Connect key and mouse events for slider update feedback.
- window.connectEventList([pyxbmct.ACTION_MOVE_LEFT,
- pyxbmct.ACTION_MOVE_RIGHT,
- pyxbmct.ACTION_MOUSE_DRAG,
- pyxbmct.ACTION_MOUSE_LEFT_CLICK],
- list_update)
- curltimelabel = pyxbmct.Label('[COLOR=lightgray]' + strings.getstring("curltimelabeltext") + '[/COLOR]', 'font14')
- window.placeControl(curltimelabel, 238, 109, 10, 30)
- curltimelabel.setVisible(False)
- currentcurlsetting = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("currentsetting") + '[/COLOR]')
- window.placeControl(currentcurlsetting, 285, 87, 10, 30)
- currentcurlsetting.setVisible(False)
- global slider2value
- slider2value = pyxbmct.Label('[COLOR=darkgray]' + str(SLIDER2_INIT_VALUE)+ '[/COLOR]', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(slider2value, 304, 107)
- slider2value.setVisible(False)
- recommendedcurlsetting = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("recommendedsettingcurl") + '[/COLOR]')
- window.placeControl(recommendedcurlsetting, 285, 123, 10, 35)
- recommendedcurlsetting.setVisible(False)
- #### slider 3
- # Slider value label
- SLIDER3_INIT_VALUE = 50
- # Slider
- global slider3
- slider3 = pyxbmct.Slider(textureback=slidertexture)
- window.placeControl(slider3, 360, 90, 25, 60)
- slider3.setPercent(SLIDER3_INIT_VALUE)
- slider3.setVisible(False)
- #Connect key and mouse events for slider update feedback.
- window.connectEventList([pyxbmct.ACTION_MOVE_LEFT,
- pyxbmct.ACTION_MOVE_RIGHT,
- pyxbmct.ACTION_MOUSE_DRAG,
- pyxbmct.ACTION_MOUSE_LEFT_CLICK],
- list_update)
- # +90
- readbufferfactorlabel = pyxbmct.Label('[COLOR=lightgray]' + strings.getstring("readbufferfactorlabel") + '[/COLOR]', 'font14')
- window.placeControl(readbufferfactorlabel, 328, 105, 10, 30)
- readbufferfactorlabel.setVisible(False)
- currentrbfsetting = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("currentsetting") + '[/COLOR]')
- window.placeControl(currentrbfsetting, 375, 87, 10, 30)
- currentrbfsetting.setVisible(False)
- global slider3value
- slider3value = pyxbmct.Label('[COLOR=darkgray]' + str(SLIDER3_INIT_VALUE) + '[/COLOR]', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(slider3value, 394, 107)
- slider3value.setVisible(False)
- recommendedrbfsetting = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("recommendedrbfsetting") + '[/COLOR]')
- window.placeControl(recommendedrbfsetting, 375, 123, 10, 35)
- recommendedrbfsetting.setVisible(False)
- slider3.setVisible(False)
- readbufferfactorlabel.setVisible(False)
- currentrbfsetting.setVisible(False)
- slider3value.setVisible(False)
- recommendedrbfsetting.setVisible(False)
- global speedtestprevlabel
- speedtestprevlabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("speedtestprevlabel") + '[/COLOR]')
- window.placeControl(speedtestprevlabel, 360, 108, 10, 34)
- speedtestprevlabel.setVisible(False)
- ################### R A d I O b U T T O N S ##########################################################################################
- buffermodelabel = pyxbmct.Label('[COLOR=lightgray]' + strings.getstring("buffermodelabel") + '[/COLOR]', 'font14')
- window.placeControl(buffermodelabel, 418, 108, columnspan=25, rowspan=30)
- buffermodelabel.setVisible(False)
- mode1radiobutton = pyxbmct.RadioButton('[COLOR=goldenrod]1[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(mode1radiobutton, 458, 83, columnspan=13, rowspan=40)
- window.connect(mode1radiobutton, radio1_update)
- mode1radiobutton.setVisible(False)
- mode2radiobutton = pyxbmct.RadioButton('[COLOR=goldenrod]2->(Recommended)[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(mode2radiobutton, 458, 95, columnspan=35, rowspan=40)
- window.connect(mode2radiobutton, radio2_update)
- mode2radiobutton.setVisible(False)
- mode3radiobutton = pyxbmct.RadioButton('[COLOR=goldenrod]3[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(mode3radiobutton, 458, 129, columnspan=13, rowspan=40)
- window.connect(mode3radiobutton, radio3_update)
- mode3radiobutton.setVisible(False)
- mode4radiobutton = pyxbmct.RadioButton('[COLOR=goldenrod]4[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(mode4radiobutton, 458, 141, columnspan=13, rowspan=40)
- window.connect(mode4radiobutton, radio4_update)
- mode4radiobutton.setVisible(False)
- automaintenanceradio = pyxbmct.RadioButton('[COLOR=goldenrod]' + strings.getstring("automaintenanceradio") + '[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(automaintenanceradio, 410, 6, columnspan=78, rowspan=43)
- window.connect(automaintenanceradio, automaintenanceradio_update)
- automaintenanceradio.setVisible(False)
- automaintenancefreqeverytime = pyxbmct.RadioButton('[COLOR=goldenrod]' + strings.getstring("automaintenancefreqeverytime") + '[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(automaintenancefreqeverytime, 505, 6, columnspan=22, rowspan=43)
- window.connect(automaintenancefreqeverytime, automaintenancefreqeverytime_update)
- automaintenancefreqeverytime.setVisible(False)
- automaintenancefreqeverytime.setEnabled(False)
- automaintenancefreqdaily = pyxbmct.RadioButton('[COLOR=goldenrod]Daily[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(automaintenancefreqdaily, 505, 27, columnspan=18, rowspan=43)
- window.connect(automaintenancefreqdaily, automaintenancefreqdaily_update)
- automaintenancefreqdaily.setVisible(False)
- automaintenancefreqdaily.setEnabled(False)
- automaintenancefreqweekly = pyxbmct.RadioButton('[COLOR=goldenrod]Weekly[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(automaintenancefreqweekly, 505, 45, columnspan=19, rowspan=43)
- window.connect(automaintenancefreqweekly, automaintenancefreqweekly_update)
- automaintenancefreqweekly.setVisible(False)
- automaintenancefreqweekly.setEnabled(False)
- automaintenancefreqmonthly = pyxbmct.RadioButton('[COLOR=goldenrod]Monthly[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(automaintenancefreqmonthly, 505, 64, columnspan=18, rowspan=43)
- window.connect(automaintenancefreqmonthly, automaintenancefreqmonthly_update)
- automaintenancefreqmonthly.setVisible(False)
- automaintenancefreqmonthly.setEnabled(False)
- fullautomaintenanceradio = pyxbmct.RadioButton('[COLOR=goldenrod]' + strings.getstring("fullautomaintenanceradio") + '[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(fullautomaintenanceradio, 410, 90, columnspan=78, rowspan=43)
- window.connect(fullautomaintenanceradio, fullautomaintenanceradio_update)
- fullautomaintenanceradio.setVisible(False)
- fullautomaintcacheradio = pyxbmct.RadioButton('[COLOR=goldenrod]Cache[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(fullautomaintcacheradio, 475, 90, columnspan=26, rowspan=43)
- window.connect(fullautomaintcacheradio, fullautomaintcacheradio_update)
- fullautomaintcacheradio.setVisible(False)
- fullautomaintcacheradio.setEnabled(False)
- fullautomaintpackagesradio = pyxbmct.RadioButton('[COLOR=goldenrod]Packages[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(fullautomaintpackagesradio, 475, 115, columnspan=27, rowspan=43)
- window.connect(fullautomaintpackagesradio, fullautomaintpackagesradio_update)
- fullautomaintpackagesradio.setVisible(False)
- fullautomaintpackagesradio.setEnabled(False)
- fullautomaintthumbradio = pyxbmct.RadioButton('[COLOR=goldenrod]Thumbnails[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(fullautomaintthumbradio, 475, 141, columnspan=26, rowspan=43)
- window.connect(fullautomaintthumbradio, fullautomaintthumbradio_update)
- fullautomaintthumbradio.setVisible(False)
- fullautomaintthumbradio.setEnabled(False)
- fullautomaintweekradio = pyxbmct.RadioButton('[COLOR=goldenrod]Week[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(fullautomaintweekradio, 537, 90, columnspan=26, rowspan=43)
- window.connect(fullautomaintweekradio, fullautomaintweekradio_update)
- fullautomaintweekradio.setVisible(False)
- fullautomaintweekradio.setEnabled(False)
- fullautomaintmonthradio = pyxbmct.RadioButton('[COLOR=goldenrod]Month[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(fullautomaintmonthradio, 537, 115, columnspan=27, rowspan=43)
- window.connect(fullautomaintmonthradio, fullautomaintmonthradio_update)
- fullautomaintmonthradio.setVisible(False)
- fullautomaintmonthradio.setEnabled(False)
- fullautomaintquarterradio = pyxbmct.RadioButton('[COLOR=goldenrod]Quarter[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(fullautomaintquarterradio, 537, 141, columnspan=26, rowspan=43)
- window.connect(fullautomaintquarterradio, fullautomaintquarterradio_update)
- fullautomaintquarterradio.setVisible(False)
- fullautomaintquarterradio.setEnabled(False)
- cacheinclude_genesis = pyxbmct.RadioButton('[COLOR=goldenrod]Genesis[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(cacheinclude_genesis, 215, 122, columnspan=23, rowspan=40)
- window.connect(cacheinclude_genesis, cacheinclude_genesis_update)
- cacheinclude_genesis.setVisible(False)
- cacheinclude_navix = pyxbmct.RadioButton('[COLOR=goldenrod]Navi-X[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(cacheinclude_navix, 215, 144, columnspan=23, rowspan=40)
- window.connect(cacheinclude_navix, cacheinclude_navix_update)
- cacheinclude_navix.setVisible(False)
- # cacheinclude_metahandler = pyxbmct.RadioButton('[COLOR=goldenrod]Metadata[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- # window.placeControl(cacheinclude_metahandler, 251, 122, columnspan=23, rowspan=40)
- # window.connect(cacheinclude_metahandler, fullautomaintquarterradio_update)
- # cacheinclude_metahandler.setVisible(False)
- cacheinclude_youtube = pyxbmct.RadioButton('[COLOR=goldenrod]Youtube[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(cacheinclude_youtube, 251, 122, columnspan=23, rowspan=40)
- window.connect(cacheinclude_youtube, cacheinclude_youtube_update)
- cacheinclude_youtube.setVisible(False)
- cacheinclude_ivue = pyxbmct.RadioButton('[COLOR=goldenrod]iVue[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(cacheinclude_ivue, 251, 144, columnspan=23, rowspan=40)
- window.connect(cacheinclude_ivue, cacheinclude_ivue_update)
- cacheinclude_ivue.setVisible(False)
- cacheinclude_salts = pyxbmct.RadioButton('[COLOR=goldenrod]' + strings.getstring("salts") + '[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(cacheinclude_salts, 287, 122, columnspan=23, rowspan=40)
- window.connect(cacheinclude_salts, cacheinclude_salts_update)
- cacheinclude_salts.setVisible(False)
- cacheinclude_pulsar = pyxbmct.RadioButton('[COLOR=goldenrod]Pulsar[/COLOR]', noFocusTexture=listtexture, _alignment=6)
- window.placeControl(cacheinclude_pulsar, 287, 144, columnspan=23, rowspan=40)
- window.connect(cacheinclude_pulsar, cacheinclude_pulsar_update)
- cacheinclude_pulsar.setVisible(False)
- #################### b U T T O N S ########################################################################################################################
- browsebuildsbutton = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("browsebuildsbutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(browsebuildsbutton, 30, 2, columnspan=25, rowspan=50)
- window.connect(browsebuildsbutton, lambda:
- showbuildmenu())
- browseaddonsbutton = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("browseaddonsbutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(browseaddonsbutton, 30, 26, columnspan=25, rowspan=50)
- window.connect(browseaddonsbutton, lambda:
- showaddontypelist())
- maintenancebutton = pyxbmct.Button('[COLOR=goldenrod]Maintenance[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(maintenancebutton, 30, 50, columnspan=25, rowspan=50)
- window.connect(maintenancebutton, lambda:
- maintenance2())
- backupbutton = pyxbmct.Button('[COLOR=goldenrod]Backup[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(backupbutton, 30, 74, columnspan=25, rowspan=50)
- window.connect(backupbutton, lambda:
- bakcupbuttonpush())
- tweaksbutton = pyxbmct.Button('[COLOR=goldenrod]Tweaks[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(tweaksbutton, 30, 98, columnspan=25, rowspan=50)
- window.connect(tweaksbutton, lambda:
- tweaks())
- morebutton = pyxbmct.Button('[COLOR=goldenrod]More[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(morebutton, 30, 122, columnspan=25, rowspan=50)
- window.connect(morebutton, lambda:
- more())
- settingsbutton = pyxbmct.Button('[COLOR=goldenrod]Settings[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(settingsbutton, 30, 146, columnspan=25, rowspan=50)
- window.connect(settingsbutton, lambda:
- xbmcaddon.Addon().openSettings())
- freshstartbutton = pyxbmct.Button('[COLOR=goldenrod]Fresh Start[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(freshstartbutton, 120, 71, columnspan=24, rowspan=50)
- freshstartbutton.setVisible(False)
- window.connect(freshstartbutton, lambda: freshstart())
- installbuildbutton = pyxbmct.Button('[COLOR=goldenrod]Install[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(installbuildbutton, 180, 71, columnspan=24, rowspan=50)
- installbuildbutton.setVisible(False)
- window.connect(installbuildbutton, lambda: installbuild())
- repairbuildbutton = pyxbmct.Button('[COLOR=goldenrod]Repair[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(repairbuildbutton, 240, 71, columnspan=24, rowspan=50)
- repairbuildbutton.setVisible(False)
- window.connect(repairbuildbutton, lambda: repairbuild())
- installaddonbutton = pyxbmct.Button('[COLOR=goldenrod]Install[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(installaddonbutton, 120, 71, columnspan=24, rowspan=50)
- installaddonbutton.setVisible(False)
- window.connect(installaddonbutton, lambda: installbutton())
- voteaddonbutton = pyxbmct.Button('[COLOR=goldenrod]Rate[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(voteaddonbutton, 180, 71, columnspan=24, rowspan=50)
- voteaddonbutton.setVisible(False)
- window.connect(voteaddonbutton, lambda: user.rateaddon(username, name, mac, deviceid))
- voterepobutton = pyxbmct.Button('[COLOR=goldenrod]Rate[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(voterepobutton, 180, 71, columnspan=24, rowspan=50)
- voterepobutton.setVisible(False)
- window.connect(voterepobutton, lambda: user.raterepo(username, name, mac, deviceid))
- votebuildbutton = pyxbmct.Button('[COLOR=goldenrod]Rate[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(votebuildbutton, 300, 71, columnspan=24, rowspan=50)
- votebuildbutton.setVisible(False)
- window.connect(votebuildbutton, lambda: user.ratebuild(username, selectname, mac, deviceid))
- uninstalladdonbutton = pyxbmct.Button('[COLOR=goldenrod]Uninstall[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(uninstalladdonbutton, 240, 71, columnspan=24, rowspan=50)
- uninstalladdonbutton.setVisible(False)
- window.connect(uninstalladdonbutton, lambda: uninstallbutton())
- global addaddonbyrepobutton
- addaddonbyrepobutton = pyxbmct.Button('[COLOR=goldenrod]Add[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(addaddonbyrepobutton, 300, 71, columnspan=24, rowspan=50)
- addaddonbyrepobutton.setVisible(False)
- window.connect(addaddonbyrepobutton, lambda:
- manageaddon.findaddoninrepo('add', username, deviceid, mac))
- global updateaddonbutton
- updateaddonbutton = pyxbmct.Button('[COLOR=goldenrod]Update[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(updateaddonbutton, 360, 71, columnspan=24, rowspan=50)
- updateaddonbutton.setVisible(False)
- window.connect(updateaddonbutton, lambda:
- manageaddon.findaddoninrepo('update', username, deviceid, mac))
- global deletethumbnailsbuttonv2
- deletethumbnailsbuttonv2 = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("deletethumbnailsbutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(deletethumbnailsbuttonv2, 335, 10, columnspan=30, rowspan=50)
- deletethumbnailsbuttonv2.setVisible(False)
- window.connect(deletethumbnailsbuttonv2, lambda: deletethumbnails())
- global deletepackagesbuttonv2
- deletepackagesbuttonv2 = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("deletepackagesbutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(deletepackagesbuttonv2, 335, 51, columnspan=30, rowspan=50)
- deletepackagesbuttonv2.setVisible(False)
- window.connect(deletepackagesbuttonv2, lambda: deletepackages())
- global deletecachebuttonv2
- deletecachebuttonv2 = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("deletecachebutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(deletecachebuttonv2, 335, 92, columnspan=30, rowspan=50)
- deletecachebuttonv2.setVisible(False)
- window.connect(deletecachebuttonv2, lambda: deletecache())
- global tweakcache_page1button
- tweakcache_page1button = pyxbmct.Button('[COLOR=goldenrod]Next[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(tweakcache_page1button, 510, 108, columnspan=30, rowspan=50)
- tweakcache_page1button.setVisible(False)
- window.connect(tweakcache_page1button, lambda:
- tweakcache_page1())
- global tweakcache_page2button
- tweakcache_page2button = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("tweakcache_page2button") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(tweakcache_page2button, 510, 105, columnspan=35, rowspan=50)
- tweakcache_page2button.setVisible(False)
- window.connect(tweakcache_page2button, lambda:
- tweakcache_page2())
- global applycachetweakbutton
- applycachetweakbutton = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("applycachetweakbutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(applycachetweakbutton, 510, 103, columnspan=35, rowspan=50)
- applycachetweakbutton.setVisible(False)
- window.connect(applycachetweakbutton, lambda:
- applycachetweak(newcache, newcurl, newrbf, newbuffermode))
- global loginbutton
- loginbutton = pyxbmct.Button('[COLOR=goldenrod]Login[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(loginbutton, -30, 2, columnspan=25, rowspan=50)
- loginbutton.setVisible(False)
- window.connect(loginbutton, lambda: login())
- loginbutton.setVisible(False)
- global activatebutton
- activatebutton = pyxbmct.Button('[COLOR=goldenrod]Activate[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(activatebutton, -30, 2, columnspan=25, rowspan=50)
- activatebutton.setVisible(False)
- window.connect(activatebutton, lambda: activate())
- activatebutton.setVisible(False)
- global logoutbutton
- logoutbutton = pyxbmct.Button('[COLOR=goldenrod]Logout[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(logoutbutton, -30, 2, columnspan=25, rowspan=50)
- logoutbutton.setVisible(False)
- window.connect(logoutbutton, lambda: logout())
- logoutbutton.setVisible(False)
- global closebutton
- closebutton = pyxbmct.Button('[COLOR=goldenrod]Close[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(closebutton, -30, 146, columnspan=25, rowspan=50)
- closebutton.setVisible(True)
- window.connect(closebutton, lambda: close())
- closebutton.setVisible(True)
- global unblockurlbutton
- unblockurlbutton = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("unblockurlbutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(unblockurlbutton, 390, 108, columnspan=30, rowspan=50)
- unblockurlbutton.setVisible(False)
- window.connect(unblockurlbutton, lambda: changeurl())
- global dospeedtestbutton
- dospeedtestbutton = pyxbmct.Button('[COLOR=goldenrod]Start Test[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
- window.placeControl(dospeedtestbutton, 302, 108, columnspan=24, rowspan=50)
- dospeedtestbutton.setVisible(False)
- window.connect(dospeedtestbutton, lambda: speedtestfunc())
- #######################################################################################################################################################
- ################### L I S T S ###################################################################################################################
- buildlist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
- window.placeControl(buildlist, 110, 3, 500, 65)
- buildlist.setVisible(False)
- window.connect(buildlist, lambda: buildfeaturedselect())
- buildmainlist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
- window.placeControl(buildmainlist, 110, 3, 500, 65)
- buildmainlist.setVisible(False)
- window.connect(buildmainlist, lambda: buildmainselect())
- buildotherlist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
- window.placeControl(buildotherlist, 110, 3, 500, 65)
- buildotherlist.setVisible(False)
- window.connect(buildotherlist, lambda: buildtoherselect())
- addonlist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
- window.placeControl(addonlist, 110, 3, 500, 65)
- addonlist.setVisible(False)
- window.connect(addonlist, lambda: window.setFocus(installaddonbutton))
- addontypelist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
- window.placeControl(addontypelist, 110, 3, 500, 65)
- addontypelist.setVisible(False)
- window.connect(addontypelist, lambda: getaddons())
- repolist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
- window.placeControl(repolist, 110, 3, 500, 65)
- repolist.setVisible(False)
- window.connect(repolist, lambda: window.setFocus(installaddonbutton))
- tweakslist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
- window.placeControl(tweakslist, 110, 3, 500, 65)
- tweakslist.setVisible(False)
- window.connect(tweakslist, lambda: tweakslistselect())
- morelist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
- window.placeControl(morelist, 110, 3, 500, 65)
- morelist.setVisible(False)
- window.connect(morelist, lambda: morelistselect())
- ##########################################################################################################################################################
- ############ I M A G e S ###############################################################################################################################
- global windowimage
- windowimage = pyxbmct.Image('')
- window.placeControl(windowimage, 110, 98, 265, 70)
- global windowimage2
- windowimage2 = pyxbmct.Image('')
- window.placeControl(windowimage2, 110, 98, 265, 70)
- global windowimage3
- windowimage3 = pyxbmct.Image('')
- window.placeControl(windowimage3, 110, 98, 265, 70)
- global star1
- star1 = pyxbmct.Image(star_image)
- window.placeControl(star1, 439, 125, 10, 8)
- star1.setVisible(False)
- global star2
- star2 = pyxbmct.Image(star_image)
- window.placeControl(star2, 439, 131, 10, 8)
- star2.setVisible(False)
- global star3
- star3 = pyxbmct.Image(star_image)
- window.placeControl(star3, 439, 137, 10, 8)
- star3.setVisible(False)
- global star4
- star4 = pyxbmct.Image(star_image)
- window.placeControl(star4, 439, 143, 10, 8)
- star4.setVisible(False)
- global star5
- star5 = pyxbmct.Image(star_image)
- window.placeControl(star5, 439, 149, 10, 8)
- star5.setVisible(False)
- global splashimage
- splashimage = pyxbmct.Image(splashfile)
- window.placeControl(splashimage, 180, 40, 350, 100)
- splashimage.setVisible(False)
- global maintenanceimage
- maintenanceimage = pyxbmct.Image(maintenanceimagepng)
- window.placeControl(maintenanceimage, 100, 0, 500, 175)
- maintenanceimage.setVisible(False)
- global maint_thumb_green
- maint_thumb_green = pyxbmct.Image(trafficgreen)
- window.placeControl(maint_thumb_green, 120, 38, 70, 5)
- maint_thumb_green.setVisible(False)
- global maint_thumb_amber
- maint_thumb_amber = pyxbmct.Image(trafficamber)
- window.placeControl(maint_thumb_amber, 120, 38, 70, 5)
- maint_thumb_amber.setVisible(False)
- global maint_thumb_red
- maint_thumb_red = pyxbmct.Image(trafficred)
- window.placeControl(maint_thumb_red, 120, 38, 70, 5)
- maint_thumb_red.setVisible(False)
- global maint_packages_green
- maint_packages_green = pyxbmct.Image(trafficgreen)
- window.placeControl(maint_packages_green, 120, 80, 70, 5)
- maint_packages_green.setVisible(False)
- global maint_packages_amber
- maint_packages_amber = pyxbmct.Image(trafficamber)
- window.placeControl(maint_packages_amber, 120, 80, 70, 5)
- maint_packages_amber.setVisible(False)
- global maint_packages_red
- maint_packages_red = pyxbmct.Image(trafficred)
- window.placeControl(maint_packages_red, 120, 80, 70, 5)
- maint_packages_red.setVisible(False)
- global maint_cache_green
- maint_cache_green = pyxbmct.Image(trafficgreen)
- window.placeControl(maint_cache_green, 120, 163, 70, 5)
- maint_cache_green.setVisible(False)
- global maint_cache_amber
- maint_cache_amber = pyxbmct.Image(trafficamber)
- window.placeControl(maint_cache_amber, 120, 163, 70, 5)
- maint_cache_amber.setVisible(False)
- global maint_cache_red
- maint_cache_red = pyxbmct.Image(trafficred)
- window.placeControl(maint_cache_red, 120, 163, 70, 5)
- maint_cache_red.setVisible(False)
- global speedtestimage
- speedtestimage = pyxbmct.Image('')
- window.placeControl(speedtestimage, 80, 85, 230, 70)
- speedtestimage.setVisible(False)
- global speedtestimage2
- speedtestimage2 = pyxbmct.Image('')
- window.placeControl(speedtestimage2, 400, 71, 172, 50)
- speedtestimage2.setVisible(False)
- global speedtestimage3
- speedtestimage3 = pyxbmct.Image('')
- window.placeControl(speedtestimage3, 400, 120, 172, 50)
- speedtestimage3.setVisible(False)
- global scrolldownimage
- scrolldownimage = pyxbmct.Image(scrolldown)
- window.placeControl(scrolldownimage, 555, 29, 30, 15)
- scrolldownimage.setVisible(False)
- ###########################################################################################################################################################
- ############## L A b e L S #########################################################################################################################
- global maint_totallocalfileslabel
- maint_totallocalfileslabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("totalfilesdeleted") + '[/COLOR]', 'font14')
- window.placeControl(maint_totallocalfileslabel, 75, 14, 190, 75)
- maint_totallocalfileslabel.setVisible(False)
- global maint_totallocalspacelabel
- maint_totallocalspacelabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("totalspacegained") + '[/COLOR]', 'font14')
- window.placeControl(maint_totallocalspacelabel, 75, 95, 190, 75)
- maint_totallocalspacelabel.setVisible(False)
- global cachetweak_1stline
- cachetweak_1stline = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(cachetweak_1stline, 20, 85, 190, 75)
- cachetweak_1stline.setVisible(False)
- global cachetweak_2ndline
- cachetweak_2ndline = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(cachetweak_2ndline, 55, 75, 260, 100)
- cachetweak_2ndline.setVisible(False)
- global introlabel
- introlabel = pyxbmct.Label('', 'font16', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(introlabel, 120, 20, 10, 135)
- global namelabel
- namelabel = pyxbmct.Label(' ', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(namelabel, 385, 98, 10, 70)
- namelabel.setVisible(False)
- global authorlabel
- authorlabel = pyxbmct.Label(' ', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(authorlabel, 410, 98, 10, 70)
- authorlabel.setVisible(False)
- global ratingtextlabel
- ratingtextlabel = pyxbmct.Label('[COLOR=darkgray]Rating:[/COLOR]')
- window.placeControl(ratingtextlabel, 435, 115, 10, 13)
- ratingtextlabel.setVisible(False)
- global downloadstextlabel
- downloadstextlabel = pyxbmct.Label('[COLOR=darkgray]Downloads:[/COLOR]')
- window.placeControl(downloadstextlabel, 466, 115, 10, 20)
- downloadstextlabel.setVisible(False)
- global downloadslabel
- downloadslabel = pyxbmct.Label(' ')
- window.placeControl(downloadslabel, 466, 131, 10, 13)
- downloadslabel.setVisible(False)
- global votestextlabel
- votestextlabel = pyxbmct.Label('[COLOR=darkgray]Votes:[/COLOR]')
- window.placeControl(votestextlabel, 466, 143, 10, 13)
- votestextlabel.setVisible(False)
- global voteslabel
- voteslabel = pyxbmct.Label(' ')
- window.placeControl(voteslabel, 466, 153, 10, 13)
- voteslabel.setVisible(False)
- global sizetextlabel
- sizetextlabel = pyxbmct.Label('[COLOR=darkgray]Size(MB):[/COLOR]')
- window.placeControl(sizetextlabel, 495, 117, 10, 18)
- sizetextlabel.setVisible(False)
- global sizelabel
- sizelabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("pressonbuild") + '[/COLOR]')
- window.placeControl(sizelabel, 495, 131, 10, 40)
- sizelabel.setVisible(False)
- global statustextlabel
- statustextlabel = pyxbmct.Label('[COLOR=darkgray]Status:[/COLOR]')
- window.placeControl(statustextlabel, 495, 118, 10, 13)
- statustextlabel.setVisible(False)
- global statuslabel
- statuslabel = pyxbmct.Label(' ')
- window.placeControl(statuslabel, 495, 128, 10, 40)
- statuslabel.setVisible(False)
- ##### NOT USED #########################################################################################################
- global recversiontextlabel
- recversiontextlabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("recversiontextlabel") + '[/COLOR]')
- window.placeControl(recversiontextlabel, 520, 113, 10, 34)
- recversiontextlabel.setVisible(False)
- global recversionlabel
- recversionlabel = pyxbmct.Label('')
- window.placeControl(recversionlabel, 520, 144, 10, 34)
- recversionlabel.setVisible(False)
- ####################################################################################################################################
- global installedversiontextlabel
- installedversiontextlabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("installedversiontextlabel") + '[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(installedversiontextlabel, 520, 110, 10, 34)
- installedversiontextlabel.setVisible(False)
- global installedversionlabel
- installedversionlabel = pyxbmct.Label('')
- window.placeControl(installedversionlabel, 520, 144, 10, 34)
- installedversionlabel.setVisible(False)
- global deletepackageslabel
- deletepackageslabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("deletepackageslabel") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(deletepackageslabel, 80, 72, 250, 102)
- deletepackageslabel.setVisible(False)
- global deletethumbnailslabel
- deletethumbnailslabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("deletethumbnailslabel") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(deletethumbnailslabel, 80, 72, 310, 102)
- deletethumbnailslabel.setVisible(False)
- global deletecachelabel
- deletecachelabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("deletecachelabel") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(deletecachelabel, 80, 72, 430, 102)
- deletecachelabel.setVisible(False)
- global maintenancelabel
- maintenancelabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("maintenancelabel") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(maintenancelabel, 80, 64, 460, 115)
- maintenancelabel.setVisible(False)
- global tweakcachelabel1
- tweakcachelabel1 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("tweakcachelabel1") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(tweakcachelabel1, 80, 64, 450, 115)
- tweakcachelabel1.setVisible(False)
- global tweakcachelabel2
- tweakcachelabel2 = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(tweakcachelabel2, 90, 75, 440, 100)
- tweakcachelabel2.setVisible(False)
- global tweakcachelabel3
- tweakcachelabel3 = pyxbmct.Label('[COLOR=lightgray]' + strings.getstring("tweakcachelabel3") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(tweakcachelabel3, 200, 75, 440, 100)
- tweakcachelabel3.setVisible(False)
- global automaintenancelabel1
- automaintenancelabel1 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("automaintenancelabel1") + '[/COLOR]', 'font14')
- window.placeControl(automaintenancelabel1, 460, 7, 10, 105)
- automaintenancelabel1.setVisible(False)
- automaintenancelabel1.setEnabled(False)
- global fullyautomaintenancelabel1
- fullyautomaintenancelabel1 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("fullautomaintenancelabel1") + '[/COLOR]', 'font14')
- window.placeControl(fullyautomaintenancelabel1, 443, 110, 10, 105)
- fullyautomaintenancelabel1.setVisible(False)
- fullyautomaintenancelabel1.setEnabled(False)
- global fullyautomaintenancelabel2
- fullyautomaintenancelabel2 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("fullyautomaintenancelabel2") + '[/COLOR]', 'font14')
- window.placeControl(fullyautomaintenancelabel2, 505, 123, 10, 105)
- fullyautomaintenancelabel2.setVisible(False)
- fullyautomaintenancelabel2.setEnabled(False)
- # global automaintenancelabel2
- # automaintenancelabel2 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("automaintenancelabel2") + '[/COLOR]', 'font14')
- # window.placeControl(automaintenancelabel2, 95, 70, 10, 80)
- # automaintenancelabel2.setVisible(False)
- global unblocklabel
- unblocklabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("unblocklabel") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(unblocklabel, 95, 70, 100, 105)
- unblocklabel.setVisible(False)
- global unblocklabel2
- unblocklabel2 = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(unblocklabel2, 170, 70, 100, 105)
- unblocklabel2.setVisible(False)
- global unblocklabel3
- unblocklabel3 = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(unblocklabel3, 200, 70, 100, 105)
- unblocklabel3.setVisible(False)
- global unblocklabel4
- unblocklabel4 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("unblocklabel4") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(unblocklabel4, 270, 70, 100, 105)
- unblocklabel4.setVisible(False)
- global unblocklabel5
- unblocklabel5 = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(unblocklabel5, 300, 70, 100, 105)
- unblocklabel5.setVisible(False)
- global unblocklabelbad
- unblocklabelbad = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
- window.placeControl(unblocklabelbad, 170, 70, 100, 105)
- unblocklabelbad.setVisible(False)
- global maint_thumb_label
- maint_thumb_label = pyxbmct.Label('[COLOR=darkgray]Thumbnails[/COLOR]', 'font14')
- window.placeControl(maint_thumb_label, 138, 18, 30, 40)
- maint_thumb_label.setVisible(False)
- global maint_thumb_label2
- maint_thumb_label2 = pyxbmct.Label('[COLOR=darkgray]Files:[/COLOR]', 'font14')
- window.placeControl(maint_thumb_label2, 205, 17, 30, 40)
- maint_thumb_label2.setVisible(False)
- global maint_thumb_label3
- maint_thumb_label3 = pyxbmct.Label('[COLOR=darkgray]Size:[/COLOR]', 'font14')
- window.placeControl(maint_thumb_label3, 235, 17, 30, 40)
- maint_thumb_label3.setVisible(False)
- global maint_thumb_label4
- maint_thumb_label4 = pyxbmct.Label('', 'font14')
- window.placeControl(maint_thumb_label4, 205, 25, 30, 40)
- maint_thumb_label4.setVisible(False)
- global maint_thumb_label5
- maint_thumb_label5 = pyxbmct.Label('', 'font14')
- window.placeControl(maint_thumb_label5, 235, 25, 30, 40)
- maint_thumb_label5.setVisible(False)
- global maint_packages_label
- maint_packages_label = pyxbmct.Label('[COLOR=darkgray]Packages[/COLOR]', 'font14')
- window.placeControl(maint_packages_label, 138, 61, 30, 40)
- maint_packages_label.setVisible(False)
- global maint_packages_label2
- maint_packages_label2 = pyxbmct.Label('[COLOR=darkgray]Files:[/COLOR]', 'font14')
- window.placeControl(maint_packages_label2, 205, 58, 30, 40)
- maint_packages_label2.setVisible(False)
- global maint_packages_label3
- maint_packages_label3 = pyxbmct.Label('[COLOR=darkgray]Size:[/COLOR]', 'font14')
- window.placeControl(maint_packages_label3, 235, 58, 30, 40)
- maint_packages_label3.setVisible(False)
- global maint_packages_label4
- maint_packages_label4 = pyxbmct.Label('', 'font14')
- window.placeControl(maint_packages_label4, 205, 66, 30, 40)
- maint_packages_label4.setVisible(False)
- global maint_packages_label5
- maint_packages_label5 = pyxbmct.Label('', 'font14')
- window.placeControl(maint_packages_label5, 235, 66, 30, 40)
- maint_packages_label5.setVisible(False)
- global maint_cache_label
- maint_cache_label = pyxbmct.Label('[COLOR=darkgray]Cache[/COLOR]', 'font14')
- window.placeControl(maint_cache_label, 125, 123, 30, 40)
- maint_cache_label.setVisible(False)
- global maint_cache_label2
- maint_cache_label2 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("cachelabeltemp") + '[/COLOR]', 'font14')
- window.placeControl(maint_cache_label2, 145, 116, 30, 40)
- maint_cache_label2.setVisible(False)
- global maint_cache_label3
- maint_cache_label3 = pyxbmct.Label('[COLOR=darkgray]Files:[/COLOR]', 'font14')
- window.placeControl(maint_cache_label3, 205, 98, 30, 40)
- maint_cache_label3.setVisible(False)
- global maint_cache_label4
- maint_cache_label4 = pyxbmct.Label('[COLOR=darkgray]Size:[/COLOR]', 'font14')
- window.placeControl(maint_cache_label4, 235, 98, 30, 40)
- maint_cache_label4.setVisible(False)
- global maint_cache_label5
- maint_cache_label5 = pyxbmct.Label('', 'font14')
- window.placeControl(maint_cache_label5, 205, 106, 30, 40)
- maint_cache_label5.setVisible(False)
- global maint_cache_label6
- maint_cache_label6 = pyxbmct.Label('', 'font14')
- window.placeControl(maint_cache_label6, 235, 106, 30, 40)
- maint_cache_label6.setVisible(False)
- global maint_cache_label7
- maint_cache_label7 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("cachelabelinclude") + '[/COLOR]', 'font14')
- window.placeControl(maint_cache_label7, 184, 131, 30, 40)
- maint_cache_label7.setVisible(False)
- kerneltextlabel = pyxbmct.Label('[COLOR=lightgray]Kernel:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(kerneltextlabel, 90, 20, columnspan=1)
- kerneltextlabel.setVisible(False)
- kernellabel = pyxbmct.Label('[COLOR=lightgray]' + kernel + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(kernellabel, 90, 31, columnspan=1)
- kernellabel.setVisible(False)
- cpufreqtextlabel = pyxbmct.Label('[COLOR=lightgray]CPU Frequency:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(cpufreqtextlabel, 120, 8, columnspan=1)
- cpufreqtextlabel.setVisible(False)
- cpufreqlabel = pyxbmct.Label('[COLOR=lightgray]' + cpufreq + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(cpufreqlabel, 120, 31, columnspan=1)
- cpufreqlabel.setVisible(False)
- gputextlabel = pyxbmct.Label('[COLOR=lightgray]GPU:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(gputextlabel, 150, 22, columnspan=1)
- gputextlabel.setVisible(False)
- gpulabel = pyxbmct.Label('[COLOR=lightgray]' + gpu + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(gpulabel, 150, 31, columnspan=1)
- gpulabel.setVisible(False)
- kodiversiontextlabel = pyxbmct.Label('[COLOR=lightgray] Kodi Version:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(kodiversiontextlabel, 200, 11, columnspan=1)
- kodiversiontextlabel.setVisible(False)
- kodiversionlabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.BuildVersion') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(kodiversionlabel, 200, 31, columnspan=1)
- kodiversionlabel.setVisible(False)
- kodibuildtextlabel = pyxbmct.Label('[COLOR=lightgray]Kodi Build Date:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(kodibuildtextlabel, 230, 8, columnspan=1)
- kodibuildtextlabel.setVisible(False)
- kodibuildlabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.BuildDate') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(kodibuildlabel, 230, 31, columnspan=1)
- kodibuildlabel.setVisible(False)
- screenmodetextlabel = pyxbmct.Label('[COLOR=lightgray]Screen Mode:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(screenmodetextlabel, 280, 11, columnspan=1)
- screenmodetextlabel.setVisible(False)
- screenmodelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.ScreenMode') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(screenmodelabel, 280, 31, columnspan=1)
- screenmodelabel.setVisible(False)
- networkstatetextlabel = pyxbmct.Label('[COLOR=lightgray]Network State:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(networkstatetextlabel, 330, 10, columnspan=1)
- networkstatetextlabel.setVisible(False)
- networkstatelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('Network.LinkState') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(networkstatelabel, 330, 31, columnspan=1)
- networkstatelabel.setVisible(False)
- internaliptextlabel = pyxbmct.Label('[COLOR=lightgray] Internal IP Address:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(internaliptextlabel, 360, 3, columnspan=1)
- internaliptextlabel.setVisible(False)
- internaliplabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('Network.IPAddress') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(internaliplabel, 360, 31, columnspan=1)
- internaliplabel.setVisible(False)
- macaddresstextlabel = pyxbmct.Label('[COLOR=lightgray]Mac Address:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(macaddresstextlabel, 410, 11, columnspan=1)
- macaddresstextlabel.setVisible(False)
- macaddresslabel = pyxbmct.Label('[COLOR=lightgray]' + mac + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(macaddresslabel, 410, 31, columnspan=1)
- macaddresslabel.setVisible(False)
- gatewaytextlabel = pyxbmct.Label('[COLOR=lightgray]Gateway IP Address:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(gatewaytextlabel, 440, 2, columnspan=1)
- gatewaytextlabel.setVisible(False)
- gatewaylabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('Network.GatewayAddress') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(gatewaylabel, 440, 31, columnspan=1)
- gatewaylabel.setVisible(False)
- dnstextlabel = pyxbmct.Label('[COLOR=lightgray]Network DNS Address:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(dnstextlabel, 470, 0, columnspan=1)
- dnstextlabel.setVisible(False)
- dnslabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('Network.DNS1Address') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(dnslabel, 470, 31, columnspan=1)
- dnslabel.setVisible(False)
- interetstatetextlabel = pyxbmct.Label('[COLOR=lightgray]Internet State:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(interetstatetextlabel, 520, 11, columnspan=1)
- interetstatetextlabel.setVisible(False)
- internetstatelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.InternetState') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- # Place the label on the window grid.
- window.placeControl(internetstatelabel, 520, 31, columnspan=1)
- internetstatelabel.setVisible(False)
- cputemptextlabel = pyxbmct.Label('[COLOR=lightgray]CPU Temp:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(cputemptextlabel, 90, 110, columnspan=1)
- cputemptextlabel.setVisible(False)
- cputemplabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.CPUTemperature') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(cputemplabel, 90, 127, columnspan=1)
- cputemplabel.setVisible(False)
- cpuuseagetextlabel = pyxbmct.Label('[COLOR=lightgray]CPU Useage:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(cpuuseagetextlabel, 120, 108, columnspan=1)
- cpuuseagetextlabel.setVisible(False)
- cpuusagelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.CpuUsage') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(cpuusagelabel, 120, 127, columnspan=40, rowspan=1)
- cpuusagelabel.setVisible(False)
- freestoragetextlabel = pyxbmct.Label('[COLOR=lightgray]Free Storage Space:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(freestoragetextlabel, 170, 99, columnspan=1)
- freestoragetextlabel.setVisible(False)
- freestoragelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.FreeSpace') + ' (' + xbmc.getInfoLabel('System.FreeSpacePercent') + ')' + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(freestoragelabel, 170, 127, columnspan=1)
- freestoragelabel.setVisible(False)
- usedstoragetextlabel = pyxbmct.Label('[COLOR=lightgray]Used Storage Space:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(usedstoragetextlabel, 200, 98, columnspan=1)
- usedstoragetextlabel.setVisible(False)
- usedstoragelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.UsedSpace') + ' (' + xbmc.getInfoLabel('System.UsedSpacePercent') + ')' + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(usedstoragelabel, 200, 127, columnspan=1)
- usedstoragelabel.setVisible(False)
- totalstoragetextlabel = pyxbmct.Label('[COLOR=lightgray]Total Storage Space:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(totalstoragetextlabel, 230, 98, columnspan=1)
- totalstoragetextlabel.setVisible(False)
- totalstoragelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.TotalSpace') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(totalstoragelabel, 230, 127, columnspan=1)
- totalstoragelabel.setVisible(False)
- freeramtextlabel = pyxbmct.Label('[COLOR=lightgray] Free RAM Memory:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(freeramtextlabel, 280, 100, columnspan=1)
- freeramtextlabel.setVisible(False)
- freeramlabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.FreeMemory') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(freeramlabel, 280, 127, columnspan=1)
- freeramlabel.setVisible(False)
- externaliptextlabel = pyxbmct.Label('[COLOR=lightgray]External IP Address:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(externaliptextlabel, 330, 99, columnspan=1)
- externaliptextlabel.setVisible(False)
- #externaliplabel = pyxbmct.Label('[COLOR=lightgray]' + ip + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- externaliplabel = pyxbmct.Label('[COLOR=lightgray][/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(externaliplabel, 330, 127, columnspan=1)
- externaliplabel.setVisible(False)
- isptextlabel = pyxbmct.Label('[COLOR=lightgray] ISP : [/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(isptextlabel, 360, 119, columnspan=1)
- isptextlabel.setVisible(False)
- #isplabel = pyxbmct.Label('[COLOR=lightgray]' + isp + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- isplabel = pyxbmct.Label('[COLOR=lightgray][/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(isplabel, 360, 127, columnspan=1)
- isplabel.setVisible(False)
- countrytextlabel = pyxbmct.Label('[COLOR=lightgray]Country:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(countrytextlabel, 390, 114, columnspan=1)
- countrytextlabel.setVisible(False)
- #countrylabel = pyxbmct.Label('[COLOR=lightgray]' + country + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- countrylabel = pyxbmct.Label('[COLOR=lightgray][/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(countrylabel, 390, 127, columnspan=1)
- countrylabel.setVisible(False)
- citytextlabel = pyxbmct.Label('[COLOR=lightgray]City:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
- window.placeControl(citytextlabel, 420, 119, columnspan=1)
- citytextlabel.setVisible(False)
- #citylabel = pyxbmct.Label('[COLOR=lightgray]' + city + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- citylabel = pyxbmct.Label('[COLOR=lightgray][/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
- window.placeControl(citylabel, 420, 127, columnspan=1)
- citylabel.setVisible(False)
- #############################################################################################################################################################
- window.connectEventList(
- [pyxbmct.ACTION_MOVE_DOWN,
- pyxbmct.ACTION_MOVE_UP,
- pyxbmct.ACTION_MOUSE_WHEEL_DOWN,
- pyxbmct.ACTION_MOUSE_WHEEL_UP,
- pyxbmct.ACTION_MOUSE_MOVE],
- list_update)
- # Set navigation between controls
- browsebuildsbutton.controlLeft(settingsbutton)
- browsebuildsbutton.controlRight(browseaddonsbutton)
- browsebuildsbutton.controlDown(buildlist)
- browseaddonsbutton.controlLeft(browsebuildsbutton)
- browseaddonsbutton.controlRight(maintenancebutton)
- browseaddonsbutton.controlDown(addontypelist)
- backupbutton.controlLeft(maintenancebutton)
- backupbutton.controlRight(tweaksbutton)
- backupbutton.controlDown(repolist)
- maintenancebutton.controlLeft(browseaddonsbutton)
- maintenancebutton.controlRight(backupbutton)
- tweaksbutton.controlLeft(backupbutton)
- tweaksbutton.controlRight(morebutton)
- morebutton.controlLeft(tweaksbutton)
- morebutton.controlRight(settingsbutton)
- settingsbutton.controlLeft(morebutton)
- settingsbutton.controlRight(browsebuildsbutton)
- buildlist.controlUp(browsebuildsbutton)
- addontypelist.controlUp(browseaddonsbutton)
- addonlist.controlUp(browseaddonsbutton)
- repolist.controlUp(browseaddonsbutton)
- addonlist.controlRight(installaddonbutton)
- installaddonbutton.controlLeft(addonlist)
- installaddonbutton.controlUp(browseaddonsbutton)
- installaddonbutton.controlDown(voteaddonbutton)
- voteaddonbutton.controlUp(installaddonbutton)
- voteaddonbutton.controlDown(uninstalladdonbutton)
- voteaddonbutton.controlLeft(addonlist)
- uninstalladdonbutton.controlUp(voteaddonbutton)
- uninstalladdonbutton.controlDown(installaddonbutton)
- uninstalladdonbutton.controlLeft(addonlist)
- settingsbutton.controlUp(closebutton)
- closebutton.controlDown(settingsbutton)
- votebuildbutton.controlUp(installaddonbutton)
- votebuildbutton.controlLeft(buildlist)
- voterepobutton.controlLeft(repolist)
- voterepobutton.controlUp(installaddonbutton)
- voterepobutton.controlDown(uninstalladdonbutton)
- # if userlevel == "staff" or userlevel == "admin":
- # blankbutton2.setVisible(True)
- # blankbutton1.setVisible(True)
- if accountstatus == "staff" or accountstatus == "admin" or accountstatus =="Registered" or accountstatus == "donator" or accountstatus == "free" or accountstatus == "updater":
- introlabel.setLabel('[COLOR=darkgray]' + strings.getstring("introlabel_loggedin") + '[/COLOR]')
- window.setFocus(browsebuildsbutton)
- splashimage.setVisible(True)
- logoutbutton.setVisible(True)
- closebutton.setVisible(True)
- logoutbutton.controlDown(browsebuildsbutton)
- browsebuildsbutton.controlUp(logoutbutton)
- if accountstatus == "free":
- loginbutton.setVisible(True)
- loginbutton.controlDown(browsebuildsbutton)
- closebutton.controlDown(settingsbutton)
- browsebuildsbutton.controlUp(loginbutton)
- settingsbutton.controlUp(closebutton)
- logoutbutton.setVisible(False)
- elif accountstatus == "awaiting_activation":
- introlabel.setLabel('[COLOR=darkgray]' + strings.getstring("introlabel_awating_activation") + '[/COLOR]')
- # browsebuildsbutton.setEnabled(False)
- # browseaddonsbutton.setEnabled(False)
- # browserepobutton.setEnabled(False)
- # maintenancebutton.setEnabled(False)
- # tweaksbutton.setEnabled(False)
- # morebutton.setEnabled(False)
- activatebutton.setVisible(True)
- window.setFocus(activatebutton)
- activatebutton.controlDown(browsebuildsbutton)
- browsebuildsbutton.controlUp(activatebutton)
- splashimage.setVisible(True)
- closebutton.setVisible(True)
- else:
- introlabel.setLabel('[COLOR=darkgray]' + strings.getstring("introlabel_register") + '[/COLOR]')
- browsebuildsbutton.setEnabled(False)
- browseaddonsbutton.setEnabled(False)
- backupbutton.setEnabled(False)
- maintenancebutton.setEnabled(False)
- tweaksbutton.setEnabled(False)
- morebutton.setEnabled(False)
- loginbutton.setVisible(True)
- window.setFocus(loginbutton)
- loginbutton.controlDown(browsebuildsbutton)
- browsebuildsbutton.controlUp(loginbutton)
- introlabel.setVisible(True)
- window.connect(pyxbmct.ACTION_NAV_BACK, window.close)
- # Show the created window.
- window.doModal()
- # Delete the window instance when it is no longer used.
- del window
Add Comment
Please, Sign In to add comment