Skip to content

Commit 7a8964a

Browse files
committed
arm-pack-manager - fix tracebacks
Fix tracebacks from trying to read dictionary values that don't exist and from incorrect variable names.
1 parent 469b547 commit 7a8964a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tools/arm_pack_manager/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,9 @@ def get_flash_algorthim_binary(self, device_name) :
251251
:return: A file-like object that, when read, is the ELF file that describes the flashing algorithm
252252
:rtype: ZipExtFile
253253
"""
254-
pack = self.pack_from_cache(self.index[device_name])
255-
return pack.open(device['algorithm']['file'])
254+
device = self.index[device_name]
255+
pack = self.pack_from_cache(device)
256+
return pack.open(device['algorithm'].keys()[0])
256257

257258
def get_svd_file(self, device_name) :
258259
"""Retrieve the flash algorithm file for a particular part.
@@ -264,7 +265,8 @@ def get_svd_file(self, device_name) :
264265
:return: A file-like object that, when read, is the ELF file that describes the flashing algorithm
265266
:rtype: ZipExtFile
266267
"""
267-
pack = self.pack_from_cache(self.index[device_name])
268+
device = self.index[device_name]
269+
pack = self.pack_from_cache(device)
268270
return pack.open(device['debug'])
269271

270272
def generate_index(self) :
@@ -407,7 +409,7 @@ def pdsc_from_cache(self, url) :
407409
with open(dest, "r") as fd :
408410
return BeautifulSoup(fd, "html.parser")
409411

410-
def pack_from_cache(self, url) :
412+
def pack_from_cache(self, device) :
411413
"""Low level inteface for extracting a PACK file from the cache.
412414
413415
Assumes that the file specified is a PACK file and is in the cache.

0 commit comments

Comments
 (0)