示例#1
0
	def gotSession(self, session):
		self.session = session
		self.Console = Console()
		keymap = resolveFilename(SCOPE_PLUGINS, "Extensions/CamRestart/keymap.xml")
		global globalActionMap
		loadKeymap(keymap)
		globalActionMap.actions['showCamRestart'] = self.restartCam
示例#2
0
 def gotSession(self, session):
     self.timer = eTimer()  # check timer
     self.timer.callback.append(self.ShowHide)
     global globalActionMap
     loadKeymap(
         resolveFilename(SCOPE_PLUGINS, "Extensions/ShowClock/keymap.xml"))
     self.dialog = session.instantiateDialog(ShowClock)
     globalActionMap.actions['showClock'] = self.ShowHide
示例#3
0
 def start_key(self):
     if config.plugins.PermanentClock.show_hide.value and not self.clockey:
         if 'showClock' not in globalActionMap.actions:
             loadKeymap(
                 resolveFilename(SCOPE_PLUGINS,
                                 "Extensions/PermanentClock/keymap.xml"))
             globalActionMap.actions['showClock'] = self.ShowHideKey
         self.clockey = True
    def gotSession(self, session):
        global globalActionMap
        try:
            rcbutton = config.plugins.PPrestige.scut.value
        except:
            rcbutton = 'text'

        ScreenGrabber_keymap = resolveFilename(SCOPE_PLUGINS, 'Extensions/PurePrestige/Stools/Moretools/ScreenGrabber/keymaps/' + rcbutton + '_keymap.xml')
        self.session = session
        loadKeymap(ScreenGrabber_keymap)
        globalActionMap.actions['ShowScreenGrabber'] = self.ShowHide
示例#5
0
 def gotSession(self, session):
     self.session = session
     self.qsignal = None
     if os_path.exists("/tmp/.qsignal"):
         os_remove("/tmp/.qsignal")
     keymap = resolveFilename(SCOPE_PLUGINS,
                              "Extensions/RaedQuickSignal/keymap.xml")
     global globalActionMap
     loadKeymap(keymap)
     if 'displayHelp' in globalActionMap.actions:
         del globalActionMap.actions['displayHelp']
     elif 'showSherlock' in globalActionMap.actions:
         del globalActionMap.actions['showSherlock']
     globalActionMap.actions['showRaedQuickSignal'] = self.ShowHide
示例#6
0
    def readPluginList(self, directory):
        """enumerates plugins"""
        new_plugins = []
        for c in os.listdir(directory):
            directory_category = os.path.join(directory, c)
            if not os.path.isdir(directory_category):
                continue
            for pluginname in os.listdir(directory_category):
                if pluginname == "__pycache__" or pluginname == "WebInterface":
                    continue
                path = os.path.join(directory_category, pluginname)
                if os.path.isdir(path):
                    profile('plugin ' + pluginname)
                    try:
                        plugin = my_import('.'.join(
                            ["Plugins", c, pluginname, "plugin"]))
                        plugins = plugin.Plugins(path=path)
                    except Exception as exc:
                        print("[PluginComponent] Plugin ",
                              c + "/" + pluginname, "failed to load:", exc)
                        # supress errors due to missing plugin.py* files (badly removed plugin)
                        for fn in ('plugin.py', 'plugin.pyo'):
                            if os.path.exists(os.path.join(path, fn)):
                                self.warnings.append(
                                    (c + "/" + pluginname, str(exc)))
                                from traceback import print_exc
                                print_exc()
                                break
                        else:
                            print(
                                "[PluginComponent] Plugin probably removed, but not cleanly in",
                                path)
                            try:
                                os.rmdir(path)
                            except:
                                pass
                        continue

                    # allow single entry not to be a list
                    if not isinstance(plugins, list):
                        plugins = [plugins]

                    for p in plugins:
                        p.path = path
                        p.updateIcon(path)
                        new_plugins.append(p)

                    keymap = os.path.join(path, "keymap.xml")
                    if fileExists(keymap):
                        try:
                            loadKeymap(keymap)
                        except Exception as exc:
                            print(
                                "[PluginComponent] keymap for plugin %s/%s failed to load: "
                                % (c, pluginname), exc)
                            self.warnings.append(
                                (c + "/" + pluginname, str(exc)))

        # build a diff between the old list of plugins and the new one
        # internally, the "fnc" argument will be compared with __eq__
        plugins_added = [p for p in new_plugins if p not in self.pluginList]
        plugins_removed = [
            p for p in self.pluginList
            if not p.internal and p not in new_plugins
        ]

        #ignore already installed but reloaded plugins
        for p in plugins_removed:
            for pa in plugins_added:
                if pa.path == p.path and pa.where == p.where:
                    pa.needsRestart = False

        for p in plugins_removed:
            self.removePlugin(p)

        for p in plugins_added:
            if self.firstRun or p.needsRestart is False:
                self.addPlugin(p)
            else:
                for installed_plugin in self.installedPluginList:
                    if installed_plugin.path == p.path:
                        if installed_plugin.where == p.where:
                            p.needsRestart = False
                self.addPlugin(p)

        if self.firstRun:
            self.firstRun = False
            self.installedPluginList = self.pluginList
示例#7
0
def readKeymap(filename):
    return loadKeymap(filename)
profile("RecordingConfig")
import Components.RecordingConfig
Components.RecordingConfig.InitRecordingConfig()

profile("UsageConfig")
import Components.UsageConfig
Components.UsageConfig.InitUsageConfig()

profile("TimeZones")
from Components.Timezones import InitTimeZones
InitTimeZones()

profile("Keymap")
from Components.ActionMap import loadKeymap
loadKeymap(config.usage.keymap.value)

profile("Network")
from Components.Network import InitNetwork
InitNetwork()

profile("LCD")
import Components.Lcd
Components.Lcd.InitLcd()
Components.Lcd.IconCheck()

if platform == "dm4kgen" or model in ("dm7080", "dm820"):
	filename = "/proc/stb/hdmi-rx/0/hdmi_rx_monitor"
	check = fileReadLine(filename, "", source=MODULE_NAME)
	if check.startswith("on"):
		fileWriteLine(filename, "off", source=MODULE_NAME)