소스 검색

🔨 Clean up upload.py (#23679)

GHGiampy 2 년 전
부모
커밋
6af5cb295c
No account linked to committer's email address
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4
    4
      buildroot/share/scripts/upload.py

+ 4
- 4
buildroot/share/scripts/upload.py 파일 보기

@@ -142,7 +142,7 @@ def Upload(source, target, env):
142 142
     upload_port = _GetUploadPort(env)               # Serial port to use
143 143
 
144 144
     # Set local upload params
145
-    upload_firmware_target_name = os.path.basename(upload_firmware_source_name)     # WARNING! Need rework on "binary_stream" to allow filename > 8.3
145
+    upload_firmware_target_name = os.path.basename(upload_firmware_source_name)
146 146
                                                     # Target firmware filename
147 147
     upload_timeout = 1000                           # Communication timout, lossy/slow connections need higher values
148 148
     upload_blocksize = 512                          # Transfer block size. 512 = Autodetect
@@ -154,11 +154,11 @@ def Upload(source, target, env):
154 154
     # Set local upload params based on board type to change script behavior
155 155
     # "upload_delete_old_bins": delete all *.bin files in the root of SD Card
156 156
     upload_delete_old_bins = marlin_motherboard in ['BOARD_CREALITY_V4',   'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V422', 'BOARD_CREALITY_V423',
157
-                                                    'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452',  'BOARD_CREALITY_V453',
157
+                                                    'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431',  'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453',
158 158
                                                     'BOARD_CREALITY_V24S1']
159 159
     # "upload_random_name": generate a random 8.3 firmware filename to upload
160 160
     upload_random_filename = marlin_motherboard in ['BOARD_CREALITY_V4',   'BOARD_CREALITY_V4210', 'BOARD_CREALITY_V422', 'BOARD_CREALITY_V423',
161
-                                                    'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431', 'BOARD_CREALITY_V452',  'BOARD_CREALITY_V453',
161
+                                                    'BOARD_CREALITY_V427', 'BOARD_CREALITY_V431',  'BOARD_CREALITY_V452', 'BOARD_CREALITY_V453',
162 162
                                                     'BOARD_CREALITY_V24S1'] and not marlin_long_filename_host_support
163 163
 
164 164
     try:
@@ -258,7 +258,7 @@ def Upload(source, target, env):
258 258
             print('Trigger firmware update...')
259 259
             protocol.send_ascii('M997', True)
260 260
 
261
-        protocol: protocol.shutdown()
261
+        protocol.shutdown()
262 262
         print('Firmware update completed')
263 263
 
264 264
     except KeyboardInterrupt:

Loading…
취소
저장