def submit_pin(self): result = self.plex_network.check_signin_status(self.identifier) if result: self.digit_one.setVisible(False) self.digit_two.setVisible(False) self.digit_three.setVisible(False) self.digit_four.setVisible(False) self.manual_button.setVisible(False) self.cancel_button.setVisible(False) self.submit_button.setVisible(False) self.pin_button.setVisible(False) self.submit_pin_button.setVisible(False) # tick mark self.tick = pyxbmct.Image("%s/resources/media/tick.png" % GLOBAL_SETUP['__cwd__'], aspectRatio=2) self.placeControl(self.tick, 2, 2, columnspan=2, rowspan=2) self.description.setText('Successfully Signed In') xbmc.sleep(2000) printDebug("Successfully signed in") self.close() else: printDebug("Not Successful signed in") self.display_pin(True)
def submit_pin(self): result = self.plex_network.check_signin_status(self.identifier) if result: self.digit_one.setVisible(False) self.digit_two.setVisible(False) self.digit_three.setVisible(False) self.digit_four.setVisible(False) self.manual_button.setVisible(False) self.cancel_button.setVisible(False) self.submit_button.setVisible(False) self.pin_button.setVisible(False) self.submit_pin_button.setVisible(False) #tick mark self.tick = pyxbmct.Image("%s/resources/media/tick.png" % GLOBAL_SETUP['__cwd__'], aspectRatio=2) self.placeControl(self.tick, 2 , 2 , columnspan=2, rowspan=2) self.description.setText('Successfully Signed In') xbmc.sleep(2000) printDebug("Successfully signed in") self.close() else: printDebug("Not Successful signed in") self.display_pin(True)
def submit(self): token = self.plex_network.sign_into_myplex( self.name_field.getText(), self.password_field.getText()) if token is not None: self.name_label.setVisible(False) self.password_label.setVisible(False) self.name_field.setVisible(False) self.password_field.setVisible(False) self.manual_button.setVisible(False) self.cancel_button.setVisible(False) self.submit_button.setVisible(False) self.pin_button.setVisible(False) # tick mark self.tick = pyxbmct.Image("%s/resources/media/tick.png" % GLOBAL_SETUP['__cwd__'], aspectRatio=2) self.placeControl(self.tick, 2, 2, columnspan=2, rowspan=2) self.description.setText('Successfully Signed In') xbmc.sleep(2000) printDebug("Successfully signed in") self.close() else: printDebug("Not Successful signed in") self.display_manual(True)
def submit(self): token = self.plex_network.sign_into_myplex(self.name_field.getText(), self.password_field.getText()) if token is not None: self.name_label.setVisible(False) self.password_label.setVisible(False) self.name_field.setVisible(False) self.password_field.setVisible(False) self.manual_button.setVisible(False) self.cancel_button.setVisible(False) self.submit_button.setVisible(False) self.pin_button.setVisible(False) #tick mark self.tick = pyxbmct.Image("%s/resources/media/tick.png" % GLOBAL_SETUP['__cwd__'], aspectRatio=2) self.placeControl(self.tick, 2 , 2 , columnspan=2, rowspan=2) self.description.setText('Successfully Signed In') xbmc.sleep(2000) printDebug("Successfully signed in") self.close() else: printDebug("Not Successful signed in") self.display_manual(True)
def deleteCache(self, force=False): printDebug.debug("== ENTER: deleteCache ==") cache_suffix = ".cache" persistant_cache_suffix = ".pcache" dirs, file_list = xbmcvfs.listdir(self.cache_location) printDebug.debug("List of file: [%s]" % file_list) printDebug.debug("List of dirs: [%s]" % dirs) for file in file_list: if force and persistant_cache_suffix in file: printDebug("Force deletion of persistent cache file") elif cache_suffix not in file: continue if xbmcvfs.delete(self.cache_location + file): printDebug.debug("SUCCESSFUL: removed %s" % file) else: printDebug.debug("UNSUCESSFUL: did not remove %s" % file)
def deleteCache(self, force=False): printDebug.debug("== ENTER: deleteCache ==") cache_suffix = ".cache" persistant_cache_suffix = ".pcache" dirs, file_list = xbmcvfs.listdir(self.cache_location) printDebug.debug("List of file: [%s]" % file_list) printDebug.debug("List of dirs: [%s]" % dirs) for file in file_list: if force and persistant_cache_suffix in file: printDebug("Force deletion of persistent cache file") elif cache_suffix not in file: continue if xbmcvfs.delete(self.cache_location+file): printDebug.debug("SUCCESSFUL: removed %s" % file) else: printDebug.debug("UNSUCESSFUL: did not remove %s" % file )
import pyxbmct.addonwindow as pyxbmct import plex from common import printDebug, GLOBAL_SETUP import xbmc printDebug = printDebug("PleXBMC", "plex_signin") class plex_signin(pyxbmct.AddonFullWindow): def __init__(self, title=''): """Class constructor""" # Call the base class' constructor. super(plex_signin, self).__init__(title) # Set width, height and the grid parameters self.setGeometry(600, 400, 6, 6) # Call set controls method self.set_controls() # Call set navigation method. self.set_navigation() # Connect Backspace button to close our addon. self.connect(pyxbmct.ACTION_NAV_BACK, self.close) self.plex_network = None self.identifier = None def start(self): self.display_pin() self.doModal() def set_authentication_target(self, plex_network): self.plex_network = plex_network
Requires: Kodex/Plexbmc Implementation of file based caching for python objects. Utilises pickle to store object data as file within the KODI virtual file system. ''' import xbmcvfs import time try: import cPickle as pickle except ImportError: import pickle from common import printDebug printDebug = printDebug("PleXBMC", "cachecontrol") class CacheControl: def __init__(self, cache_location, enabled=True): self.cache_location = cache_location self.enabled = enabled if self.enabled: if self.cache_location[-1] != "/": self.cache_location += "/" if not xbmcvfs.exists(self.cache_location): printDebug.debug(
Requires: Kodex/Plexbmc Implementation of file based caching for python objects. Utilises pickle to store object data as file within the KODI virtual file system. ''' import xbmcvfs import time try: import cPickle as pickle except ImportError: import pickle from common import printDebug printDebug=printDebug("PleXBMC", "cachecontrol") class CacheControl: def __init__(self, cache_location, enabled=True): self.cache_location=cache_location self.enabled=enabled if self.enabled: if self.cache_location[-1] != "/": self.cache_location+="/" if not xbmcvfs.exists(self.cache_location): printDebug.debug("CACHE [%s]: Location does not exist. Creating" % self.cache_location)
import pyxbmct.addonwindow as pyxbmct import plex from common import printDebug, GLOBAL_SETUP import xbmc printDebug=printDebug("PleXBMC", "plex_signin") class plex_signin(pyxbmct.AddonFullWindow): def __init__(self, title=''): """Class constructor""" # Call the base class' constructor. super(plex_signin, self).__init__(title) # Set width, height and the grid parameters self.setGeometry(600, 400, 6, 6) # Call set controls method self.set_controls() # Call set navigation method. self.set_navigation() # Connect Backspace button to close our addon. self.connect(pyxbmct.ACTION_NAV_BACK, self.close) self.plex_network=None self.identifier=None def start(self): self.display_pin() self.doModal() def set_authentication_target(self, plex_network): self.plex_network = plex_network def set_controls(self):