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