add custom localization support including german translation
[vuplus_dvbapp-plugin] / werbezapper / src / plugin.py
1 # for localized messages
2 from . import _
3
4 # Plugin
5 from Plugins.Plugin import PluginDescriptor
6
7 zapperInstance = None
8
9 # Mainfunction
10 def main(session, servicelist, **kwargs):
11         # Create Instance if none present, show Dialog afterwards
12         global zapperInstance
13         if zapperInstance is None:
14                 from WerbeZapper import WerbeZapper
15                 zapperInstance = WerbeZapper(session, servicelist, cleanup)
16         zapperInstance.showSelection()
17
18 def cleanup():
19         global zapperInstance
20         if zapperInstance is not None:
21                 zapperInstance.shutdown()
22                 zapperInstance = None
23
24 def Plugins(**kwargs):
25         return [
26                 PluginDescriptor(
27                         name = "Werbezapper",
28                         description = _("Automatically zaps back to current service after given Time"),
29                         where = PluginDescriptor.WHERE_EXTENSIONSMENU,
30                         fnc = main
31                 )
32         ]
33