1 # -*- coding: iso-8859-1 -*-
2 from Plugins.Plugin import PluginDescriptor
3 from Components.config import config, ConfigSubsection, ConfigEnableDisable
4 from Screens.Standby import Standby
5 from StartupToStandbyConfiguration import StartupToStandbyConfiguration
6 from enigma import eTimer
8 config.plugins.startuptostandby = ConfigSubsection()
9 config.plugins.startuptostandby.enabled = ConfigEnableDisable(default = False)
13 def main(session, **kwargs):
14 print "[StartupToStandby] Open Config Screen"
15 session.open(StartupToStandbyConfiguration)
18 def autostart(reason, **kwargs):
22 print "[StartupToStandby] autostart"
23 if config.plugins.startuptostandby.enabled.value and reason == 0 and kwargs.has_key("session"):
24 session = kwargs["session"]
26 #wait 10 seconds before setting standby again - bad hack...
27 print "[StartupToStandby] start timer..."
28 timer.timeout.get().append(timeout)
29 timer.startLongTimer(10)
30 print "[StartupToStandby] ...ready"
34 print "[StartupToStandby] Timeout!"
35 #standby-screen is open - close it
36 print "[StartupToStandby] Close Standby Screen"
39 print "[StartupToStandby] Open Standby Screen"
43 def Plugins(path, **kwargs):
44 return [PluginDescriptor(name="StartupToStandby", description="Startup To Standby", where = PluginDescriptor.WHERE_PLUGINMENU,fnc = main),
45 PluginDescriptor(name="StartupToStandby", description = "Startup To Standby", where = PluginDescriptor.WHERE_SESSIONSTART,fnc = autostart)]