2 from Plugins.Plugin import PluginDescriptor
5 from Components.config import *
8 #from Components.Language import language
11 from __init__ import *
12 from PushService import PushService
13 from PushServiceConfigScreen import PushServiceConfigScreen
14 #from PluginBase import PluginBase
15 #from ConfigDirectorySelection import ConfigDirectorySelection
21 SUPPORT = "http://www.i-have-a-dreambox.com/wbb2/thread.php?threadid=167779"
22 DONATE = "http://bit.ly/pspaypal"
23 ABOUT = "\n " + NAME + " " + VERSION + "\n\n" \
24 + _(" (C) 2012 by betonme @ IHAD \n\n") \
25 + _(" If You like this plugin and want to support it,\n") \
26 + _(" or if just want to say ''thanks'',\n") \
27 + _(" feel free to donate via PayPal. \n\n") \
28 + _(" Thanks a lot ! \n\n PayPal: ") + DONATE
36 config.pushservice = ConfigSubsection()
38 config.pushservice.about = ConfigNothing()
40 config.pushservice.enable = ConfigEnableDisable(default = True)
42 config.pushservice.boxname = ConfigText(default = "Dreambox", fixed_size = False)
43 config.pushservice.xmlpath = ConfigText(default = "/etc/enigma2/pushservice.xml", fixed_size = False)
45 config.pushservice.time = ConfigClock(default = 0)
46 config.pushservice.period = ConfigSelectionNumber(0, 1000, 1, default = 24)
47 config.pushservice.runonboot = ConfigEnableDisable(default = True)
49 config.pushservice.smtpserver = ConfigText(default="smtp.server.com", fixed_size = False)
50 config.pushservice.smtpport = ConfigNumber(default = 587)
51 config.pushservice.smtptyp = ConfigEnableDisable(default = True)
53 config.pushservice.username = ConfigText(fixed_size = False)
54 config.pushservice.password = ConfigPassword()
56 config.pushservice.mailfrom = ConfigText(default = "abc@provider.com", fixed_size = False)
57 config.pushservice.mailto = ConfigText(fixed_size = False)
60 #######################################################
61 # Plugin main function
62 def Plugins(**kwargs):
67 if config.pushservice.enable.value:
69 descriptors.append( PluginDescriptor(where = PluginDescriptor.WHERE_AUTOSTART, fnc = autostart, needsRestart = False) )
72 descriptors.append( PluginDescriptor(name = NAME, description = NAME + " " +_("configuration"), where = PluginDescriptor.WHERE_PLUGINMENU, fnc = setup, needsRestart = False) ) #icon = "/icon.png"
77 #######################################################
78 # Plugin configuration
79 def setup(session, **kwargs):
80 session.open(PushServiceConfigScreen)
83 #######################################################
85 def autostart(reason, **kwargs):
86 if reason == 0: # start
87 if config.pushservice.enable.value:
89 gPushService = PushService()
90 #TODO gPushService.load()
92 if config.pushservice.runonboot.value:
94 gPushService.start(state) #with load