git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
change hotplugNotifier to return correct state transition for cd-rom type and flash...
[enigma2.git]
/
lib
/
python
/
Plugins
/
SystemPlugins
/
Hotplug
/
plugin.py
diff --git
a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
index 469b1dd0a948af1b5da4ba4c4ab474e937a15979..e593e942b9338b708a574910ab00b4cf5d1714b9 100644
(file)
--- a/
lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
+++ b/
lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
@@
-8,6
+8,8
@@
DEVICEDB = \
"/devices/pci0000:00/0000:00:14.2/usb1/1-1/1-1:1.0/host0/target1:0:0/0:0:0:0": "SD Slot"
}
"/devices/pci0000:00/0000:00:14.2/usb1/1-1/1-1:1.0/host0/target1:0:0/0:0:0:0": "SD Slot"
}
+hotplugNotifier = [ ]
+
class Hotplug(Protocol):
def getUserfriendlyDeviceName(self, phys):
return DEVICEDB.get(phys, "USB Storage")
class Hotplug(Protocol):
def getUserfriendlyDeviceName(self, phys):
return DEVICEDB.get(phys, "USB Storage")
@@
-48,6
+50,12
@@
class Hotplug(Protocol):
harddiskmanager.addHotplugPartition(dev, self.getUserfriendlyDeviceName(physdevpath))
elif media_state == '0':
harddiskmanager.removeHotplugPartition(dev)
harddiskmanager.addHotplugPartition(dev, self.getUserfriendlyDeviceName(physdevpath))
elif media_state == '0':
harddiskmanager.removeHotplugPartition(dev)
+
+ for callback in hotplugNotifier:
+ try:
+ callback(dev, action or media_state)
+ except AttributeError:
+ hotplugNotifier.remove(callback)
def autostart(reason, **kwargs):
if reason == 0:
def autostart(reason, **kwargs):
if reason == 0: