コード例 #1
0
ファイル: usb1.py プロジェクト: AlexanderS/linux-minidisc
 def getNextTimeout(self):
     """
     Returns the next internal timeout that libusb needs to handle, in
     seconds, or None if no timeout is needed.
     You should not have to call this method, unless you are integrating
     this class with a polling mechanism.
     """
     timeval = libusb1.timeval()
     result = libusb1.libusb_get_next_timeout(self.__context_p,
         byref(timeval))
     if result == 0:
         result = None
     elif result == 1:
         result = timeval.tv_sec + (timeval.tv_usec * 0.000001)
     else:
         raise libusb1.USBError(result)
     return result
コード例 #2
0
ファイル: usb1.py プロジェクト: astraw/python-libusb1
 def getNextTimeout(self):
     return libusb1.libusb_get_next_timeout(self.context_p, None)