This commit is contained in:
croneter 2018-02-01 08:23:31 +01:00
parent 187a6131f0
commit 0daf18d5d4

View file

@ -8,19 +8,19 @@ from xbmcaddon import Addon
from xbmc import translatePath, sleep, log, LOGERROR from xbmc import translatePath, sleep, log, LOGERROR
from xbmcgui import Window from xbmcgui import Window
_addon = Addon(id='plugin.video.plexkodiconnect') _ADDON = Addon(id='plugin.video.plexkodiconnect')
try: try:
_addon_path = _addon.getAddonInfo('path').decode('utf-8') _ADDON_PATH = _ADDON.getAddonInfo('path').decode('utf-8')
except TypeError: except TypeError:
_addon_path = _addon.getAddonInfo('path').decode() _ADDON_PATH = _ADDON.getAddonInfo('path').decode()
try: try:
_base_resource = translatePath(os_path.join( _base_resource = translatePath(os_path.join(
_addon_path, _ADDON_PATH,
'resources', 'resources',
'lib')).decode('utf-8') 'lib')).decode('utf-8')
except TypeError: except TypeError:
_base_resource = translatePath(os_path.join( _base_resource = translatePath(os_path.join(
_addon_path, _ADDON_PATH,
'resources', 'resources',
'lib')).decode() 'lib')).decode()
sys_path.append(_base_resource) sys_path.append(_base_resource)
@ -30,12 +30,12 @@ from pickler import unpickle_me, pickl_window
############################################################################### ###############################################################################
if __name__ == "__main__": if __name__ == "__main__":
win = Window(10000) WINDOW = Window(10000)
while win.getProperty('plex_command'): while WINDOW.getProperty('plex_command'):
sleep(20) sleep(20)
win.setProperty('plex_command', 'CONTEXT_menu') WINDOW.setProperty('plex_command', 'CONTEXT_menu')
while not pickl_window('plex_result'): while not pickl_window('plex_result'):
sleep(50) sleep(50)
result = unpickle_me() RESULT = unpickle_me()
if result is None: if RESULT is None:
log('PLEX.%s: Error encountered, aborting' % __name__, level=LOGERROR) log('PLEX.%s: Error encountered, aborting' % __name__, level=LOGERROR)