whitespace cleanup,
[enigma2-plugins.git] / networkbrowser / src / plugin.py
1 # -*- coding: utf-8 -*-\r
2 # for localized messages\r
3 from __init__ import _\r
4 \r
5 from Plugins.Plugin import PluginDescriptor\r
6 from NetworkBrowser import NetworkBrowser\r
7 from Components.Network import iNetwork\r
8 from MountManager import AutoMountManager\r
9 \r
10 plugin_path = ""\r
11 \r
12 def NetworkBrowserMain(session, iface = None, **kwargs):\r
13         session.open(NetworkBrowser,iface, plugin_path)\r
14 \r
15 def MountManagerMain(session, iface = None, **kwargs):\r
16         session.open(AutoMountManager, iface, plugin_path)\r
17 \r
18 def NetworkBrowserCallFunction(iface):\r
19         interfaceState = iNetwork.getAdapterAttribute(iface, "up")\r
20         if interfaceState is True:\r
21                 return NetworkBrowserMain\r
22         else:\r
23                 return None\r
24 \r
25 def MountManagerCallFunction(iface):\r
26         return MountManagerMain\r
27 \r
28 def Plugins(path, **kwargs):\r
29         global plugin_path\r
30         plugin_path = path\r
31         return [\r
32                 PluginDescriptor(name=_("NetworkBrowser"), description=_("Search for network shares"), where = PluginDescriptor.WHERE_NETWORKSETUP, fnc={"ifaceSupported": NetworkBrowserCallFunction, "menuEntryName": lambda x: _("NetworkBrowser"), "menuEntryDescription": lambda x: _("Search for network shares...")}),\r
33                 PluginDescriptor(name=_("MountManager"), description=_("Manage network shares"), where = PluginDescriptor.WHERE_NETWORKSETUP, fnc={"ifaceSupported": MountManagerCallFunction, "menuEntryName": lambda x: _("MountManager"), "menuEntryDescription": lambda x: _("Manage your network shares...")})\r
34         ]\r
35 \r