this is needed for newer python versions... thanks to ritzmo
fixes bug #671
BLKRRPART = ((0x12<<IOC_TYPESHIFT) | (95<<IOC_NRSHIFT))
def autostart(reason, **kwargs):
BLKRRPART = ((0x12<<IOC_TYPESHIFT) | (95<<IOC_NRSHIFT))
def autostart(reason, **kwargs):
if reason == 0:
print "starting hotplug handler"
if fileExists('/dev/.udev'):
global netlink
if reason == 0:
print "starting hotplug handler"
if fileExists('/dev/.udev'):
global netlink
from enigma import eSocketNotifier, eTimer, ePythonMessagePump
import socket
from select import POLLIN, POLLPRI
from enigma import eSocketNotifier, eTimer, ePythonMessagePump
import socket
from select import POLLIN, POLLPRI
factory = Factory()
factory.protocol = Hotplug
reactor.listenUNIX("/tmp/hotplug.socket", factory)
factory = Factory()
factory.protocol = Hotplug
reactor.listenUNIX("/tmp/hotplug.socket", factory)
+ else:
+ if bdpoll:
+ bdpoll.running = False
+ bdpoll.timeout() # XXX: I assume the timer is shut down before it executes again, so release the semaphore manually
+ bdpoll.join()
+ bdpoll = None
def Plugins(**kwargs):
return PluginDescriptor(name = "Hotplug", description = "listens to hotplug events", where = PluginDescriptor.WHERE_AUTOSTART, needsRestart = True, fnc = autostart)
def Plugins(**kwargs):
return PluginDescriptor(name = "Hotplug", description = "listens to hotplug events", where = PluginDescriptor.WHERE_AUTOSTART, needsRestart = True, fnc = autostart)