예제 #1
0
        AddonSettings.clear_cached_addon_settings_object()
        # close the log to prevent locking on next call
        Logger.instance().close_log()
        log_file = None

    except:
        if log_file:
            log_file.critical("Error running plugin", exc_info=True)
            log_file.close_log()
        raise


# setup the paths in Python
from initializer import Initializer  # nopep8
Initializer.set_unicode()
currentPath = Initializer.setup_python_paths()

# ANY OF THESE SETTINGS SHOULD ONLY BE ENABLED FOR DEBUGGING PURPOSES
# from debug import remotedebugger
# debugger = remotedebugger.RemoteDebugger()

# Debugging with profiler
# import profile as cProfile
# import cProfile
# from debug import profilelinebyline as cProfile

# Path for PC
# statsPath = os.path.abspath(os.path.join(currentPath, "../DEV/retrospect.pc.leia.pstat"))
# Path for ATV
# statsPath = os.path.abspath("/private/var/mobile/retrospect.atv.pstat")
# Path for rPi
예제 #2
0
import os
import sys
import xbmc
import xbmcgui

# we need to import the initializer
addOnPath = os.path.abspath(os.path.join(os.path.dirname(__file__), "..",
                                         ".."))
sys.path.append(addOnPath)

# setup some initial stuff
from initializer import Initializer

Initializer.set_unicode()
Initializer.setup_python_paths()
sys.path.remove(addOnPath)

from retroconfig import Config
from logger import Logger

Logger.create_logger(os.path.join(Config.profileDir, Config.logFileNameAddon),
                     Config.appName,
                     append=True,
                     dual_logger=lambda x, y=4: xbmc.log(x, y))

from helpers.htmlentityhelper import HtmlEntityHelper
from addonsettings import AddonSettings, LOCAL
from favourites import Favourites
from paramparser import ParameterParser
from helpers.channelimporter import ChannelIndex