首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在启动/启动时运行基于enigma2的dreambox插件?

如何在启动/启动时运行基于enigma2的dreambox插件?
EN

Stack Overflow用户
提问于 2013-08-13 13:32:21
回答 2查看 2.1K关注 0票数 4

我在enigma2中为dreambox.I开发了一个插件,我用过这个东西

代码语言:javascript
复制
def Plugins(**kwargs):

    return PluginDescriptor(
           name="01loginscreendemo",
           description="loginScreenDemo ",
           where = PluginDescriptor.WHERE_PLUGINMENU,
           icon="../images.jpg",
           fnc=main)

因此它会在插件菜单上显示我插件。

可以在启动时运行插件吗?多么?

EN

回答 2

Stack Overflow用户

发布于 2014-01-29 16:48:31

代码语言:javascript
复制
def autostart(reason, **kwargs):
         print "startup"



def Plugins(**kwargs):
    return [
        PluginDescriptor(
            where =  PluginDescriptor.WHERE_AUTOSTART,
            fnc = autostart),
        PluginDescriptor(
            name = "esprit 2",
            description = "Test Plugit 2",
            where = PluginDescriptor.WHERE_AUTOSTART,
            icon = "../ihad_tut.png",
            fnc = main)]
票数 1
EN

Stack Overflow用户

发布于 2019-02-07 23:25:11

代码语言:javascript
复制
from Plugins.Plugin import PluginDescriptor

def autoStart(reason, **kwargs):                           # starts DURING the Enigma2 booting
    if reason == 0:    # and kwargs.has_key('session'):
        print('PLUGINSTARTDEBUGLOG - autoStart executed , reason == 0 , kwargs.has_key("session") = %s' % kwargs.has_key("session")  )
    if reason == 1:
        print('PLUGINSTARTDEBUGLOG - autoStart executed , reason == 1 , kwargs.has_key("session") = %s' % kwargs.has_key("session")  )

def mainStart(session, **kwargs):                          # starts when the plugin is opened via Plugin-MENU
    print('PLUGINSTARTDEBUGLOG - mainStart executed , kwargs.has_key("session") = %s' % kwargs.has_key("session")  )

def sessionStart(reason, session):                         # starts AFTER the Enigma2 booting
    if reason == 0:
        print('PLUGINSTARTDEBUGLOG - sessionStart executed, reason == 0')
    if reason == 1:
        print('PLUGINSTARTDEBUGLOG - sessionStart executed, reason == 1')

def Plugins(**kwargs):
    """ Register plugin in the plugin menu and prepare the plugin with autostart """
    return [
        PluginDescriptor(
            where = PluginDescriptor.WHERE_AUTOSTART,      # starts DURING the Enigma2 booting
            #where = [PluginDescriptor.WHERE_AUTOSTART , PluginDescriptor.WHERE_SESSIONSTART],
            fnc = autoStart),
        PluginDescriptor(
            where = PluginDescriptor.WHERE_SESSIONSTART,   # starts AFTER the Enigma2 booting
            fnc = sessionStart),
        PluginDescriptor(
            where = PluginDescriptor.WHERE_PLUGINMENU,     # starts when the plugin is opened via Plugin-MENU
            name = "picons updater",
            description = "picon updater for OE2.0",
            icon = "images/plugin.png",
            fnc = mainStart)
        ]
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18201342

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档