@@ -92,14 +92,11 @@ def _get_sectors(self, device):
92
92
sectors = [(flash_alg .flash_start + offset , size )
93
93
for offset , size in flash_alg .sector_sizes ]
94
94
ret .extend (sectors )
95
- except Exception as e :
96
- print (e )
97
- print (device )
95
+ except Exception :
98
96
pass
99
97
ret .sort (key = lambda sector : sector [0 ])
100
98
return ret
101
- except Exception as e :
102
- print (e )
99
+ except Exception :
103
100
return None
104
101
105
102
@property
@@ -119,11 +116,13 @@ def cache_everything(self):
119
116
def get_svd_file (self , device_name ):
120
117
"""Retrieve the flash algorithm file for a particular part.
121
118
122
- Assumes that both the PDSC and the PACK file associated with that part are in the cache.
119
+ Assumes that both the PDSC and the PACK file associated with that part
120
+ are in the cache.
123
121
124
122
:param device_name: The exact name of a device
125
123
:type device_name: str
126
- :return: A file-like object that, when read, is the ELF file that describes the flashing algorithm
124
+ :return: A file-like object that, when read, is the ELF file that
125
+ describes the flashing algorithm
127
126
:rtype: ZipExtFile
128
127
"""
129
128
device = self .index [device_name ]
@@ -134,4 +133,3 @@ def generate_index(self):
134
133
with open (LocalPackIndex , "w+" ) as out :
135
134
self ._cache .index ["version" ] = "0.2.0"
136
135
dump (self ._cache .index , out , indent = 4 , sort_keys = True )
137
-
0 commit comments