File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -246,19 +246,23 @@ def _generate_aliases_helper(self, d) :
246
246
self .counter += 1
247
247
self .display_counter ("Scanning for Aliases" )
248
248
249
- def get_flash_algorthim_binary (self , device_name ) :
249
+ def get_flash_algorthim_binary (self , device_name , all = False ) :
250
250
"""Retrieve the flash algorithm file for a particular part.
251
251
252
252
Assumes that both the PDSC and the PACK file associated with that part are in the cache.
253
253
254
254
:param device_name: The exact name of a device
255
+ :param all: Return an iterator of all flash algos for this device
255
256
:type device_name: str
256
257
:return: A file-like object that, when read, is the ELF file that describes the flashing algorithm
257
- :rtype: ZipExtFile
258
+ :return: A file-like object that, when read, is the ELF file that describes the flashing algorithm.
259
+ When "all" is set to True then an iterator for file-like objects is returned
260
+ :rtype: ZipExtFile or ZipExtFile iterator if all is True
258
261
"""
259
262
device = self .index [device_name ]
260
263
pack = self .pack_from_cache (device )
261
- return pack .open (device ['algorithm' ].keys ()[0 ])
264
+ algo_itr = (pack .open (path ) for path in device ['algorithm' ].keys ())
265
+ return algo_itr if all else algo_itr .next ()
262
266
263
267
def get_svd_file (self , device_name ) :
264
268
"""Retrieve the flash algorithm file for a particular part.
You can’t perform that action at this time.
0 commit comments