Esempio n. 1
0
		def doStandardInstall(self):
			wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s] [User Selected: Standard Install build]" % (BUILDVERSION, LATESTVERSION), xbmc.LOGNOTICE)
			wiz.log("[Check Updates] [Next Check: %s]" % str(NEXTCHECK), xbmc.LOGNOTICE)
			wiz.setS('lastbuildcheck', str(NEXTCHECK))
			self.close()
			url = 'plugin://%s/?mode=install&name=%s&url=normal' % (ADDON_ID, urllib.quote_plus(BUILDNAME))
			xbmc.executebuiltin('RunPlugin(%s)' % url)
Esempio n. 2
0
def debridIt(do, who):
    if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA)
    if not os.path.exists(REALFOLD): os.makedirs(REALFOLD)
    if who == 'all':
        for log in ORDER:
            if os.path.exists(DEBRIDID[log]['path']):
                try:
                    addonid = wiz.addonId(DEBRIDID[log]['plugin'])
                    default = DEBRIDID[log]['default']
                    user = addonid.getSetting(default)
                    if user == '' and do == 'update': continue
                    updateDebrid(do, log)
                except:
                    pass
            else:
                wiz.log(
                    '[Real Debrid Info] %s(%s) is not installed' %
                    (DEBRIDID[log]['name'], DEBRIDID[log]['plugin']),
                    xbmc.LOGERROR)
        wiz.setS('debridlastsave', str(THREEDAYS))
    else:
        if DEBRIDID[who]:
            if os.path.exists(DEBRIDID[who]['path']):
                updateDebrid(do, who)
        else:
            wiz.log('[Real Debrid Info] Invalid Entry: %s' % who,
                    xbmc.LOGERROR)
Esempio n. 3
0
def updateTrakt(do, who):
    file = TRAKTID[who]['file']
    settings = TRAKTID[who]['settings']
    data = TRAKTID[who]['data']
    addonid = wiz.addonId(TRAKTID[who]['plugin'])
    saved = TRAKTID[who]['saved']
    default = TRAKTID[who]['default']
    user = addonid.getSetting(default)
    suser = wiz.getS(saved)
    name = TRAKTID[who]['name']
    icon = TRAKTID[who]['icon']

    if do == 'update':
        if not user == '':
            try:
                with open(file, 'w') as f:
                    for trakt in data:
                        f.write(
                            '<trakt>\n\t<id>%s</id>\n\t<value>%s</value>\n</trakt>\n'
                            % (trakt, addonid.getSetting(trakt)))
                    f.close()
                user = addonid.getSetting(default)
                wiz.setS(saved, user)
                wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name),
                              '[COLOR %s]Trakt Info: Saved![/COLOR]' % COLOR2,
                              2000, icon)
            except Exception, e:
                wiz.log(
                    "[Trakt Info] Unable to Update %s (%s)" % (who, str(e)),
                    xbmc.LOGERROR)
        else:
            wiz.LogNotify(
                "[COLOR %s]%s[/COLOR]" % (COLOR1, name),
                '[COLOR %s]Trakt Info: Not Registered![/COLOR]' % COLOR2, 2000,
                icon)
Esempio n. 4
0
def traktIt(do, who):
    if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA)
    if not os.path.exists(TRAKTFOLD): os.makedirs(TRAKTFOLD)
    if who == 'all':
        for log in ORDER:
            if os.path.exists(TRAKTID[log]['path']):
                try:
                    addonid = wiz.addonId(TRAKTID[log]['plugin'])
                    default = TRAKTID[log]['default']
                    user = addonid.getSetting(default)
                    if user == '' and do == 'update': continue
                    updateTrakt(do, log)
                except:
                    pass
            else:
                wiz.log(
                    '[Trakt Info] %s(%s) is not installed' %
                    (TRAKTID[log]['name'], TRAKTID[log]['plugin']),
                    xbmc.LOGERROR)
        wiz.setS('traktlastsave', str(THREEDAYS))
    else:
        if TRAKTID[who]:
            if os.path.exists(TRAKTID[who]['path']):
                updateTrakt(do, who)
        else:
            wiz.log('[Trakt Info] Invalid Entry: %s' % who, xbmc.LOGERROR)
Esempio n. 5
0
def importlist(who):
    if who == 'all':
        for log in DEBRIDID:
            if os.path.exists(DEBRIDID[log]['file']):
                importlist(log)
    elif DEBRIDID[who]:
        if os.path.exists(DEBRIDID[who]['file']):
            d = DEBRIDID[who]['default']
            sa = DEBRIDID[who]['saved']
            su = wiz.getS(sa)
            n = DEBRIDID[who]['name']
            f = open(DEBRIDID[who]['file'], mode='r')
            g = f.read().replace('\n', '').replace('\r', '').replace('\t', '')
            f.close()
            m = re.compile('<debrid><id>%s</id><value>(.+?)</value></debrid>' %
                           d).findall(g)
            if len(m) > 0:
                if not m[0] == su:
                    if DIALOG.yesno(
                            "[COLOR %s]%s[/COLOR]" % (COLOR1, ADDONTITLE),
                            "[COLOR %s]Would you like to import the [COLOR %s]Real Debrid[/COLOR] Info for [COLOR %s]%s[/COLOR]?"
                            % (COLOR2, COLOR1, COLOR1, n),
                            "File: [COLOR green][B]%s[/B][/COLOR]" % m[0],
                            "Saved:[/COLOR] [COLOR red][B]%s[/B][/COLOR]" %
                            su if not su == '' else
                            'Saved:[/COLOR] [COLOR red][B]None[/B][/COLOR]',
                            yeslabel="[B][COLOR %s]Import Debrid[/COLOR][/B]" %
                            COLOR2,
                            nolabel="[B][COLOR %s]No, Cancel[/COLOR][/B]" %
                            COLOR1):
                        wiz.setS(sa, m[0])
                        wiz.log('[Import Data] %s: %s' % (who, str(m)),
                                xbmc.LOGNOTICE)
                    else:
                        wiz.log(
                            '[Import Data] Declined Import(%s): %s' %
                            (who, str(m)), xbmc.LOGNOTICE)
                else:
                    wiz.log('[Import Data] Duplicate Entry(%s): %s' %
                            (who, str(m))), xbmc.LOGNOTICE
            else:
                wiz.log('[Import Data] No Match(%s): %s' % (who, str(m)),
                        xbmc.LOGNOTICE)
Esempio n. 6
0
         match = re.compile(
             '<debrid><id>(.+?)</id><value>(.+?)</value></debrid>').findall(
                 g)
         try:
             if len(match) > 0:
                 for debrid, value in match:
                     addonid.setSetting(debrid, value)
             user = addonid.getSetting(default)
             wiz.setS(saved, user)
             wiz.LogNotify(
                 "[COLOR %s]%s[/COLOR]" % (COLOR1, name),
                 '[COLOR %s]Real Debrid Info: Restored![/COLOR]' % COLOR2,
                 2000, icon)
         except Exception, e:
             wiz.log(
                 "[Real Debrid Info] Unable to Restore %s (%s)" %
                 (who, str(e)), xbmc.LOGERROR)
     #else: wiz.LogNotify(name,'Real Debrid Info: [COLOR red]Not Found![/COLOR]', 2000, icon)
 elif do == 'clearaddon':
     wiz.log('%s SETTINGS: %s' % (name, settings), xbmc.LOGDEBUG)
     if os.path.exists(settings):
         try:
             f = open(settings, "r")
             lines = f.readlines()
             f.close()
             f = open(settings, "w")
             for line in lines:
                 match = wiz.parseDOM(line, 'setting', ret='id')
                 if len(match) == 0: f.write(line)
                 else:
                     if match[0] not in data: f.write(line)
Esempio n. 7
0
		def doIgnore(self):
			wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s] [User Selected: Ignore 3 Days]" % (BUILDVERSION, LATESTVERSION), xbmc.LOGNOTICE)
			wiz.log("[Check Updates] [Next Check: %s]" % str(THREEDAYS), xbmc.LOGNOTICE)
			wiz.setS('lastbuildcheck', str(THREEDAYS))
			self.close()
Esempio n. 8
0
		def doDismiss(self):
			if not test == True:
				wiz.setS("notedismiss","true")
			wiz.log("[Notification] NotifyID %s Dismissed" % wiz.getS('noteid'), xbmc.LOGNOTICE)
			self.close()
Esempio n. 9
0
		def doRemindMeLater(self):
			if not test == True:
				wiz.setS("notedismiss","false")
			wiz.log("[Notification] NotifyID %s Remind Me Later" % wiz.getS('noteid'), xbmc.LOGNOTICE)
			self.close()
Esempio n. 10
0
		def doIgnore(self):
			self.close()
			wiz.log("[First Run] [User Selected: Ignore Build Menu] [Next Check: %s]" % str(NEXTCHECK), xbmc.LOGNOTICE)
			wiz.setS('lastbuildcheck', str(NEXTCHECK))
Esempio n. 11
0
		def doBuildMenu(self):
			wiz.log("[Check Updates] [User Selected: Open Build Menu] [Next Check: %s]" % str(NEXTCHECK), xbmc.LOGNOTICE)
			wiz.setS('lastbuildcheck', str(NEXTCHECK))
			self.close()
			url = 'plugin://%s/?mode=builds' % ADDON_ID
			xbmc.executebuiltin('ActivateWindow(10025, "%s", return)' % url)
Esempio n. 12
0
                                    'Select the [COLOR green]YES[/COLOR] option in the NEXT WINDOW to wipe now.',
                                    'Select the [COLOR lightskyblue]NO[/COLOR] option in the NEXT WINDOW to update later.',
                                    '[I][COLOR smokewhite]If you wish to update later you can do so in [/COLOR][COLOR ghostwhite]PickleRicked[/COLOR] [COLOR lightsteelblue]Tools[/COLOR][/I]'
                                )
                                xbmc.executebuiltin("Dialog.Close(busydialog)")
                                wipe.FRESHSTART()
                                sys.exit(1)
                        else:
                            xbmc.executebuiltin("Dialog.Close(busydialog)")
                            sys.exit(1)

# Sleeper added before the maintenance functions due to the updating of addons.
#######################################################################
#		AUTO CLEANUP
#######################################################################
wiz.log("[Auto Cleanup] Started", xbmc.LOGNOTICE)
if AUTOCLEANUP == 'true':
    service = False
    days = [TODAY, TOMORROW, THREEDAYS, ONEWEEK]
    freq = int(float(AUTOFREQ))
    if AUTONEXTRUN <= str(TODAY) or freq == 0:
        service = True
        next_run = days[freq]
        wiz.setS('nextautocleanup', str(next_run))
    else:
        wiz.log("[Auto Cleanup] Next Cleanup %s" % AUTONEXTRUN, xbmc.LOGNOTICE)
    if service == True:
        #AUTOCACHE      = wiz.getS('clearcache')
        #AUTOPACKAGES   = wiz.getS('clearpackages')
        #AUTOTHUMBS     = wiz.getS('clearthumbs')
        if AUTOCACHE == 'true':