2016-01-12 02:53:41 +11:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2016-10-23 02:15:10 +11:00
|
|
|
###############################################################################
|
2016-01-12 02:53:41 +11:00
|
|
|
|
2016-08-30 02:44:27 +10:00
|
|
|
import logging
|
2016-01-12 02:53:41 +11:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
import xbmc
|
|
|
|
import xbmcaddon
|
|
|
|
|
2016-10-23 02:15:10 +11:00
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
_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()
|
2016-08-30 02:44:27 +10:00
|
|
|
sys.path.append(_base_resource)
|
|
|
|
|
2016-10-23 02:15:10 +11:00
|
|
|
###############################################################################
|
2016-04-07 16:34:01 +10:00
|
|
|
|
2016-08-30 02:44:27 +10:00
|
|
|
import loghandler
|
2016-10-23 02:15:10 +11:00
|
|
|
from context_entry import ContextMenu
|
2016-01-12 02:53:41 +11:00
|
|
|
|
2016-10-23 02:15:10 +11:00
|
|
|
###############################################################################
|
2016-08-30 02:44:27 +10:00
|
|
|
|
2016-10-23 02:15:10 +11:00
|
|
|
loghandler.config()
|
|
|
|
log = logging.getLogger("PLEX.contextmenu")
|
2016-08-30 02:44:27 +10:00
|
|
|
|
2016-10-23 02:15:10 +11:00
|
|
|
###############################################################################
|
2016-08-30 02:44:27 +10:00
|
|
|
|
2016-10-23 02:15:10 +11:00
|
|
|
if __name__ == "__main__":
|
2016-08-30 02:44:27 +10:00
|
|
|
|
2016-10-23 02:15:10 +11:00
|
|
|
try:
|
|
|
|
# Start the context menu
|
|
|
|
ContextMenu()
|
|
|
|
except Exception as error:
|
2017-09-06 21:52:55 +10:00
|
|
|
log.error(error)
|
2016-10-23 02:15:10 +11:00
|
|
|
import traceback
|
2017-09-06 21:52:55 +10:00
|
|
|
log.error("Traceback:\n%s" % traceback.format_exc())
|
2016-10-23 02:15:10 +11:00
|
|
|
raise
|