Ver Fonte

CLI flashers should allow files outside qmk_firmware folder (#19454)

Joel Challis há 3 anos atrás
pai
commit
61696fda83
1 ficheiros alterados com 6 adições e 6 exclusões
  1. 6 6
      lib/python/qmk/flashers.py

+ 6 - 6
lib/python/qmk/flashers.py

@@ -178,25 +178,25 @@ def flasher(mcu, file):
     # Add a small sleep to avoid race conditions
     # Add a small sleep to avoid race conditions
     time.sleep(1)
     time.sleep(1)
     if bl == 'atmel-dfu':
     if bl == 'atmel-dfu':
-        _flash_atmel_dfu(details, file.name)
+        _flash_atmel_dfu(details, file)
     elif bl == 'caterina':
     elif bl == 'caterina':
-        if _flash_caterina(details, file.name):
+        if _flash_caterina(details, file):
             return (True, "The Caterina bootloader was found but is not writable. Check 'qmk doctor' output for advice.")
             return (True, "The Caterina bootloader was found but is not writable. Check 'qmk doctor' output for advice.")
     elif bl == 'hid-bootloader':
     elif bl == 'hid-bootloader':
         if mcu:
         if mcu:
-            if _flash_hid_bootloader(mcu, details, file.name):
+            if _flash_hid_bootloader(mcu, details, file):
                 return (True, "Please make sure 'teensy_loader_cli' or 'hid_bootloader_cli' is available on your system.")
                 return (True, "Please make sure 'teensy_loader_cli' or 'hid_bootloader_cli' is available on your system.")
         else:
         else:
             return (True, "Specifying the MCU with '-m' is necessary for HalfKay/HID bootloaders!")
             return (True, "Specifying the MCU with '-m' is necessary for HalfKay/HID bootloaders!")
     elif bl == 'stm32-dfu' or bl == 'apm32-dfu' or bl == 'gd32v-dfu' or bl == 'kiibohd':
     elif bl == 'stm32-dfu' or bl == 'apm32-dfu' or bl == 'gd32v-dfu' or bl == 'kiibohd':
-        _flash_dfu_util(details, file.name)
+        _flash_dfu_util(details, file)
     elif bl == 'usbasploader' or bl == 'usbtinyisp':
     elif bl == 'usbasploader' or bl == 'usbtinyisp':
         if mcu:
         if mcu:
-            _flash_isp(mcu, bl, file.name)
+            _flash_isp(mcu, bl, file)
         else:
         else:
             return (True, "Specifying the MCU with '-m' is necessary for ISP flashing!")
             return (True, "Specifying the MCU with '-m' is necessary for ISP flashing!")
     elif bl == 'md-boot':
     elif bl == 'md-boot':
-        _flash_mdloader(file.name)
+        _flash_mdloader(file)
     else:
     else:
         return (True, "Known bootloader found but flashing not currently supported!")
         return (True, "Known bootloader found but flashing not currently supported!")