from Plugins.Plugin import PluginDescriptor
from Components.Scanner import scanDevice
+from Screens.InfoBar import InfoBar
def execute(option):
print "execute", option
global_session = None
def partitionListChanged(action, device):
- pass
-# if action == 'add' and device.is_hotplug:
-# print "mountpoint", device.mountpoint
-# print "description", device.description
-# print "force_mounted", device.force_mounted
-# mountpoint_choosen((device.description, device.mountpoint, global_session))
+ if InfoBar.instance:
+ if InfoBar.instance.execing:
+ if action == 'add' and device.is_hotplug:
+ print "mountpoint", device.mountpoint
+ print "description", device.description
+ print "force_mounted", device.force_mounted
+ mountpoint_choosen((device.description, device.mountpoint, global_session))
+ else:
+ print "main infobar is not execing... so we ignore hotplug event!"
+ else:
+ print "hotplug event.. but no infobar"
def sessionstart(reason, session):
global global_session
Screen):
ALLOW_SUSPEND = True
+ instance = None
def __init__(self, session):
Screen.__init__(self, session)
})
self.current_begin_time=0
+ assert InfoBar.instance is None, "class InfoBar is a singleton class and just one instance of this class is allowed!"
+ InfoBar.instance = self
+
+ def __onClose(self):
+ InfoBar.instance = None
def __eventInfoChanged(self):
if self.execing: