示例#1
0
	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
示例#2
0
 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
示例#3
0
 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
示例#4
0
 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
示例#5
0
	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