source: ipk/source.sh4/swapepg_crossepg/var/swap/extensions/CrossEPG/plugin.py@ 12495

Last change on this file since 12495 was 12090, checked in by madie, 14 years ago

[ipk] update crossepg

File size: 2.3 KB
Line 
1from crossepglib import CrossEPG_Config
2from crossepg_main import crossepg_main
3from crossepg_locale import _
4from Plugins.Plugin import PluginDescriptor
5
6def setup(menuid, **kwargs):
7 if menuid == "setup":
8 return [("CrossEPG", crossepg_main.setup, "crossepg", None)]
9 else:
10 return []
11
12def call_downloader(session, **kwargs):
13 crossepg_main.downloader(session)
14
15def call_loaderAsPlugin(session, **kwargs):
16 crossepg_main.loaderAsPlugin(session)
17
18def call_setup(session, **kwargs):
19 crossepg_main.setup(session)
20
21def call_autostart(reason, session):
22 crossepg_main.autostart(reason, session)
23
24def Plugins(**kwargs):
25 config = CrossEPG_Config()
26 config.load()
27 plugins = list()
28 if config.show_plugin == 1 and config.show_extension == 1:
29 plugins.append(PluginDescriptor(name="CrossEPG Downloader",
30 description=_("An EPG downloader"),
31 where = [ PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU ],
32 fnc = call_downloader))
33 elif config.show_extension == 1:
34 plugins.append(PluginDescriptor(name="CrossEPG Downloader",
35 description=_("An EPG downloader"),
36 where = PluginDescriptor.WHERE_EXTENSIONSMENU,
37 fnc = call_downloader))
38 elif config.show_plugin == 1:
39 plugins.append(PluginDescriptor(name="CrossEPG Downloader",
40 description=_("An EPG downloader"),
41 where = PluginDescriptor.WHERE_PLUGINMENU,
42 fnc = call_downloader))
43
44 if config.isQBOXHD():
45 plugins.append(PluginDescriptor(name="CrossEPG",
46 description=_("CrossEPG setup panel"),
47 where = PluginDescriptor.WHERE_PLUGINMENU,
48 fnc = call_setup))
49 else:
50 plugins.append(PluginDescriptor(name="CrossEPG",
51 description=_("CrossEPG setup panel"),
52 where = PluginDescriptor.WHERE_MENU,
53 fnc = setup))
54
55 plugins.append(PluginDescriptor(name="CrossEPG Auto",
56 description = _("CrossEPG automatic actions"),
57 where = PluginDescriptor.WHERE_SESSIONSTART,
58 fnc = call_autostart))
59
60 if config.show_force_reload_as_plugin == 1:
61 plugins.append(PluginDescriptor(name="CrossEPG Force Reload",
62 description=_("CrossEPG Force Reload"),
63 where = PluginDescriptor.WHERE_PLUGINMENU,
64 fnc = call_loaderAsPlugin))
65
66 return plugins;
Note: See TracBrowser for help on using the repository browser.