Exemple #1
0
 def _processDeviceEventIteration(self):
     for device in self.devices:
         try:
             events = device._getNativeEventBuffer()
             #if events and len(events)>0:
             #    ioHub.print2err("_processDeviceEventIteration.....", device._event_listeners)
             while len(events) > 0:
                 evt = events.popleft()
                 e = device._getIOHubEventObject(evt)
                 if e is not None:
                     for l in device._getEventListeners(
                             e[DeviceEvent.EVENT_TYPE_ID_INDEX]):
                         l._handleEvent(e)
         except:
             printExceptionDetailsToStdErr()
             print2err("Error in processDeviceEvents: ", device, " : ",
                       len(events), " : ", e)
             print2err(
                 "Event type ID: ", e[DeviceEvent.EVENT_TYPE_ID_INDEX],
                 " : ",
                 EventConstants.getName(e[DeviceEvent.EVENT_TYPE_ID_INDEX]))
             print2err("--------------------------------------")
Exemple #2
0
 def _processDeviceEventIteration(self):
     for device in self.devices:
         try:
             events=device._getNativeEventBuffer()
             #if events and len(events)>0:
             #    ioHub.print2err("_processDeviceEventIteration.....", device._event_listeners)
             while len(events)>0:
                 evt=events.popleft()
                 e=device._getIOHubEventObject(evt)
                 if e is not None:
                     for l in device._getEventListeners(e[DeviceEvent.EVENT_TYPE_ID_INDEX]):
                         l._handleEvent(e)
         except:
             printExceptionDetailsToStdErr()
             print2err("Error in processDeviceEvents: ", device, " : ", len(events), " : ", e)
             print2err("Event type ID: ",e[DeviceEvent.EVENT_TYPE_ID_INDEX], " : " , EventConstants.getName(e[DeviceEvent.EVENT_TYPE_ID_INDEX]))
             print2err("--------------------------------------")