@@ -279,14 +279,14 @@ def download_firmware(self, firmware, filename=None):
279
279
print ("Download timeout" )
280
280
if not child .is_alive ():
281
281
break
282
- print ("Waiting for download to compliete ..." )
282
+ print ("Waiting for download to complete ..." )
283
283
time .sleep (1 )
284
284
285
285
return filename
286
286
287
287
def fw_manifest_usage (self ):
288
288
'''return help on manifest subcommand'''
289
- return ("Usage: fw manifest <list|download|purge>" )
289
+ return ("Usage: fw manifest <list|download|purge|status >" )
290
290
291
291
def cmd_fw_manifest_help (self ):
292
292
'''show help on manifest subcommand'''
@@ -330,6 +330,8 @@ def cmd_fw_manifest(self, args):
330
330
return self .manifest_download ()
331
331
if args [0 ] == "list" :
332
332
return self .cmd_fw_manifest_list ()
333
+ if args [0 ] == "status" :
334
+ return self .cmd_fw_manifest_status ()
333
335
if args [0 ] == "load" :
334
336
return self .cmd_fw_manifest_load ()
335
337
if args [0 ] == "purge" :
@@ -367,14 +369,19 @@ def manifests_parse(self):
367
369
continue
368
370
self .manifests .append (manifest )
369
371
372
+ def cmd_fw_manifest_status (self ):
373
+ '''brief summary of manifest status'''
374
+ print (f"fw: { len (list (self .downloaders .keys ()))} downloaders" )
375
+ print (f"fw: { len (self .find_manifests ())} manifests" )
376
+
370
377
def download_url (self , url , path ):
371
378
mp_util .download_files ([(url ,path )])
372
379
373
380
def idle_task (self ):
374
381
'''called rapidly by mavproxy'''
375
382
if self .downloaders_lock .acquire (False ):
376
383
removed_one = False
377
- for url in self .downloaders .keys ():
384
+ for url in list ( self .downloaders .keys () ):
378
385
if not self .downloaders [url ].is_alive ():
379
386
print ("fw: Download thread for (%s) done" % url )
380
387
del self .downloaders [url ]
0 commit comments