33from pyftdi .ftdi import Ftdi
44import usb .core
55from sdwire .backend .device .usb_device import USBDevice , PortInfo
6- from sdwire .backend .block_device_utils import map_usb_device_to_block_device , find_sibling_storage_device
6+ from sdwire .backend .block_device_utils import (
7+ map_usb_device_to_block_device ,
8+ find_sibling_storage_device ,
9+ )
710
811log = logging .getLogger (__name__ )
912
@@ -34,7 +37,7 @@ def _update_block_device(self) -> None:
3437
3538 def __str__ (self ) -> str :
3639 block_dev_str = self .block_dev if self .block_dev is not None else "None"
37- return f"{ self .serial_string } \t [{ self .product_string } ::{ self .manufacturer_string } ]\t { block_dev_str } "
40+ return f"{ self .serial_string :<30 } [{ self .product_string } ::{ self .manufacturer_string } ]\t \t { block_dev_str } "
3841
3942 def __repr__ (self ) -> str :
4043 return self .__str__ ()
@@ -66,6 +69,7 @@ def _set_sdwire(self, target: int) -> None:
6669 if not self .usb_device :
6770 log .error ("USB device not available" )
6871 import sys
72+
6973 print ("USB device not available" )
7074 sys .exit (1 )
7175
@@ -77,6 +81,7 @@ def _set_sdwire(self, target: int) -> None:
7781 ftdi .close ()
7882 except Exception as e :
7983 import sys
84+
8085 log .debug ("error while updating ftdi device: %s" , e , exc_info = True )
8186 print ("couldnt switch sdwire device" )
8287 sys .exit (1 )
0 commit comments