Fix sys append using module before its init
This commit is contained in:
parent
df38786638
commit
5240afaf52
3 changed files with 48 additions and 14 deletions
|
@ -10,13 +10,25 @@ import xbmc
|
|||
import xbmcaddon
|
||||
import xbmcgui
|
||||
|
||||
import utils
|
||||
|
||||
addon_ = xbmcaddon.Addon(id='plugin.video.plexkodiconnect')
|
||||
addon_path = utils.tryDecode(addon_.getAddonInfo('path'))
|
||||
base_resource = utils.tryDecode(xbmc.translatePath(os.path.join(addon_path, 'resources', 'lib')))
|
||||
_addon = xbmcaddon.Addon(id='plugin.video.plexkodiconnect')
|
||||
try:
|
||||
addon_path = _addon.getAddonInfo('path').decode('utf-8')
|
||||
except TypeError:
|
||||
addon_path = _addon.getAddonInfo('path').decode()
|
||||
try:
|
||||
base_resource = xbmc.translatePath(os.path.join(
|
||||
addon_path,
|
||||
'resources',
|
||||
'lib')).decode('utf-8')
|
||||
except TypeError:
|
||||
base_resource = xbmc.translatePath(os.path.join(
|
||||
addon_path,
|
||||
'resources',
|
||||
'lib')).decode()
|
||||
sys.path.append(base_resource)
|
||||
|
||||
import utils
|
||||
import artwork
|
||||
import clientinfo
|
||||
import downloadutils
|
||||
|
|
20
default.py
20
default.py
|
@ -10,18 +10,30 @@ import xbmc
|
|||
import xbmcaddon
|
||||
import xbmcgui
|
||||
|
||||
import utils
|
||||
|
||||
###############################################################################
|
||||
|
||||
addon_ = xbmcaddon.Addon(id='plugin.video.plexkodiconnect')
|
||||
addon_path = utils.tryDecode(addon_.getAddonInfo('path'))
|
||||
base_resource = utils.tryDecode(xbmc.translatePath(os.path.join(addon_path, 'resources', 'lib')))
|
||||
_addon = xbmcaddon.Addon(id='plugin.video.plexkodiconnect')
|
||||
try:
|
||||
addon_path = _addon.getAddonInfo('path').decode('utf-8')
|
||||
except TypeError:
|
||||
addon_path = _addon.getAddonInfo('path').decode()
|
||||
try:
|
||||
base_resource = xbmc.translatePath(os.path.join(
|
||||
addon_path,
|
||||
'resources',
|
||||
'lib')).decode('utf-8')
|
||||
except TypeError:
|
||||
base_resource = xbmc.translatePath(os.path.join(
|
||||
addon_path,
|
||||
'resources',
|
||||
'lib')).decode()
|
||||
sys.path.append(base_resource)
|
||||
|
||||
###############################################################################
|
||||
|
||||
import entrypoint
|
||||
import utils
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
22
service.py
22
service.py
|
@ -11,19 +11,29 @@ import xbmc
|
|||
import xbmcaddon
|
||||
import xbmcgui
|
||||
|
||||
import utils
|
||||
###############################################################################
|
||||
|
||||
_addon = xbmcaddon.Addon(id='plugin.video.plexkodiconnect')
|
||||
addon_path = utils.tryDecode(_addon.getAddonInfo('path'))
|
||||
base_resource = utils.tryDecode(xbmc.translatePath(os.path.join(
|
||||
addon_path,
|
||||
'resources',
|
||||
'lib')))
|
||||
try:
|
||||
addon_path = _addon.getAddonInfo('path').decode('utf-8')
|
||||
except TypeError:
|
||||
addon_path = _addon.getAddonInfo('path').decode()
|
||||
try:
|
||||
base_resource = xbmc.translatePath(os.path.join(
|
||||
addon_path,
|
||||
'resources',
|
||||
'lib')).decode('utf-8')
|
||||
except TypeError:
|
||||
base_resource = xbmc.translatePath(os.path.join(
|
||||
addon_path,
|
||||
'resources',
|
||||
'lib')).decode()
|
||||
|
||||
sys.path.append(base_resource)
|
||||
|
||||
###############################################################################
|
||||
|
||||
import utils
|
||||
import userclient
|
||||
import clientinfo
|
||||
import initialsetup
|
||||
|
|
Loading…
Reference in a new issue