@ -436,6 +436,7 @@ class WriteLibUsb(WriteMethod):
_module_loaded = False
_module_loaded = False
try :
try :
import usb . core
import usb . core
import usb . util
_module_loaded = True
_module_loaded = True
print ( " Module usb.core detected " )
print ( " Module usb.core detected " )
except :
except :
@ -480,6 +481,9 @@ class WriteLibUsb(WriteMethod):
for i in range ( int ( len ( buf ) / 64 ) ) :
for i in range ( int ( len ( buf ) / 64 ) ) :
time . sleep ( 0.1 )
time . sleep ( 0.1 )
self . dev . write ( 1 , buf [ i * 64 : i * 64 + 64 ] )
self . dev . write ( 1 , buf [ i * 64 : i * 64 + 64 ] )
WriteLibUsb . usb . util . dispose_resources ( self . dev )
self . dev . reset ( )
self . dev = None
class WriteUsbHidApi ( WriteMethod ) :
class WriteUsbHidApi ( WriteMethod ) :
@ -525,6 +529,7 @@ class WriteUsbHidApi(WriteMethod):
sendbuf . extend ( buf [ i * 64 : i * 64 + 64 ] )
sendbuf . extend ( buf [ i * 64 : i * 64 + 64 ] )
WriteUsbHidApi . pyhidapi . hid_write ( self . dev , sendbuf )
WriteUsbHidApi . pyhidapi . hid_write ( self . dev , sendbuf )
WriteUsbHidApi . pyhidapi . hid_close ( self . dev )
WriteUsbHidApi . pyhidapi . hid_close ( self . dev )
self . dev = None
class LedNameBadge :
class LedNameBadge :