def doRead(self): for event in self.nls.parse(): try: if event['SUBSYSTEM'] == 'input': devname = event['DEVNAME'] action = event['ACTION'] if action == 'add': print "New input device detected:", devname enigma.addInputDevice(os.path.join('/dev', devname)); elif action == 'remove': print "Removed input device:", devname enigma.removeInputDevice(os.path.join('/dev', devname)); except KeyError: # Ignore "not found" pass
def doRead(self): for event in self.nls.parse(): try: if event['SUBSYSTEM'] == 'input': devname = event['DEVNAME'] action = event['ACTION'] if action == 'add': print "New input device detected:", devname enigma.addInputDevice(os.path.join('/dev', devname)) elif action == 'remove': print "Removed input device:", devname enigma.removeInputDevice(os.path.join('/dev', devname)) except KeyError: # Ignore "not found" pass
def doRead(self): for event in self.nls.parse(): try: subsystem = event['SUBSYSTEM'] if subsystem == 'input': devname = event['DEVNAME'] action = event['ACTION'] if action == 'add': print 'New input device detected:', devname enigma.addInputDevice(os.path.join('/dev', devname)) elif action == 'remove': print 'Removed input device:', devname enigma.removeInputDevice(os.path.join('/dev', devname)) elif subsystem == 'net': from Network import iNetwork iNetwork.hotplug(event) except KeyError: pass
def doRead(self): for event in self.nls.parse(): try: subsystem = event['SUBSYSTEM'] if subsystem == 'input': devname = event['DEVNAME'] action = event['ACTION'] if action == 'add': print("[InputHotplug] New input device detected:", devname) enigma.addInputDevice(path.join('/dev', devname)) elif action == 'remove': print("[InputHotplug] Removed input device:", devname) enigma.removeInputDevice(path.join('/dev', devname)) elif subsystem == 'net': from Components.Network import iNetwork iNetwork.hotplug(event) except KeyError: # Ignore "not found" pass