Skip to content

Commit cca4425

Browse files
committed
Python2+3: iteritems -> items
1 parent 45bdd98 commit cca4425

File tree

22 files changed

+47
-47
lines changed

22 files changed

+47
-47
lines changed

tools/arm_pack_manager/pack_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def fuzzy_find(matches, urls) :
6969
for key, value in process.extract(match, urls, limit=None) :
7070
choices.setdefault(key, 0)
7171
choices[key] += value
72-
choices = sorted([(v, k) for k, v in choices.iteritems()], reverse=True)
72+
choices = sorted([(v, k) for k, v in choices.items()], reverse=True)
7373
if not choices : return []
7474
elif len(choices) == 1 : return [choices[0][1]]
7575
elif choices[0][0] > choices[1][0] : choices = choices[:1]
@@ -155,7 +155,7 @@ def command_dump_parts (cache, out, parts, intersection=False) :
155155
else :
156156
for part in parts :
157157
index.update(dict(cache.find_device(part)))
158-
for n, p in index.iteritems() :
158+
for n, p in index.items() :
159159
try :
160160
if not exists(join(out, dirname(p['algorithm']['file']))) :
161161
makedirs(join(out, dirname(p['algorithm']['file'])))

tools/build_everything.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
test_builds = {}
155155
total_build_success = True
156156

157-
for target_name, target_toolchains in build_config.iteritems():
157+
for target_name, target_toolchains in build_config.items():
158158
target = TARGET_MAP[target_name]
159159

160160
for target_toolchain in target_toolchains:

tools/config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ def _process_config_and_overrides(self, data, params, unit_name, unit_kind):
673673
" is only allowed at the application level")
674674

675675
# Parse out cumulative overrides
676-
for attr, cumulatives in self.cumulative_overrides.iteritems():
676+
for attr, cumulatives in self.cumulative_overrides.items():
677677
if 'target.'+attr in overrides:
678678
key = 'target.' + attr
679679
if not isinstance(overrides[key], list):

tools/export/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def zip_export(file_name, prefix, resources, project_files, inc_repos):
226226
with zipfile.ZipFile(file_name, "w") as zip_file:
227227
for prj_file in project_files:
228228
zip_file.write(prj_file, join(prefix, basename(prj_file)))
229-
for loc, res in resources.iteritems():
229+
for loc, res in resources.items():
230230
to_zip = (
231231
res.headers + res.s_sources + res.c_sources +\
232232
res.cpp_sources + res.libraries + res.hex_files + \
@@ -320,7 +320,7 @@ def export_project(src_paths, export_path, target, ide, libraries_paths=None,
320320

321321
# Call unified scan_resources
322322
resource_dict = {loc: scan_resources(path, toolchain, inc_dirs=inc_dirs, collect_ignores=True)
323-
for loc, path in src_paths.iteritems()}
323+
for loc, path in src_paths.items()}
324324
resources = Resources()
325325
toolchain.build_dir = export_path
326326
config_header = toolchain.get_config_header()
@@ -329,12 +329,12 @@ def export_project(src_paths, export_path, target, ide, libraries_paths=None,
329329

330330
if zip_proj:
331331
subtract_basepath(resources, ".")
332-
for loc, res in resource_dict.iteritems():
332+
for loc, res in resource_dict.items():
333333
temp = copy.deepcopy(res)
334334
subtract_basepath(temp, ".", loc)
335335
resources.add(temp)
336336
else:
337-
for _, res in resource_dict.iteritems():
337+
for _, res in resource_dict.items():
338338
resources.add(res)
339339

340340
# Change linker script if specified
@@ -347,7 +347,7 @@ def export_project(src_paths, export_path, target, ide, libraries_paths=None,
347347
files.append(config_header)
348348
if zip_proj:
349349
for resource in resource_dict.values():
350-
for label, res in resource.features.iteritems():
350+
for label, res in resource.features.items():
351351
if label not in toolchain.target.features:
352352
resource.add(res)
353353
if isinstance(zip_proj, basestring):

tools/export/coide/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ class CoIDE(Exporter):
7474
def generate(self):
7575
self.resources.win_to_unix()
7676
source_files = []
77-
for r_type, n in CoIDE.FILE_TYPES.iteritems():
77+
for r_type, n in CoIDE.FILE_TYPES.items():
7878
for file in getattr(self.resources, r_type):
7979
source_files.append({
8080
'name': basename(file), 'type': n, 'path': file
8181
})
8282
header_files = []
83-
for r_type, n in CoIDE.FILE_TYPES2.iteritems():
83+
for r_type, n in CoIDE.FILE_TYPES2.items():
8484
for file in getattr(self.resources, r_type):
8585
header_files.append({
8686
'name': basename(file), 'type': n, 'path': file

tools/export/ds5_5/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def get_toolchain(self):
5050

5151
def generate(self):
5252
source_files = []
53-
for r_type, n in DS5_5.FILE_TYPES.iteritems():
53+
for r_type, n in DS5_5.FILE_TYPES.items():
5454
for file in getattr(self.resources, r_type):
5555
source_files.append({
5656
'name': basename(file), 'type': n, 'path': file

tools/export/embitz/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def _remove_symbols(sym_list):
5252
def generate(self):
5353
self.resources.win_to_unix()
5454
source_files = []
55-
for r_type, n in self.FILE_TYPES.iteritems():
55+
for r_type, n in self.FILE_TYPES.items():
5656
for file in getattr(self.resources, r_type):
5757
source_files.append({
5858
'name': file, 'type': n

tools/export/exporters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def flags(self):
104104
"""
105105
config_header = self.toolchain.get_config_header()
106106
flags = {key + "_flags": copy.deepcopy(value) for key, value
107-
in self.toolchain.flags.iteritems()}
107+
in self.toolchain.flags.items()}
108108
asm_defines = self.toolchain.get_compile_options(
109109
self.toolchain.get_symbols(for_asm=True),
110110
filter(None, self.resources.inc_dirs),

tools/export/gnuarmeclipse/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def flags(self):
9292

9393
config_header = self.toolchain.get_config_header()
9494
flags = {key + "_flags": copy.deepcopy(value) for key, value
95-
in self.toolchain.flags.iteritems()}
95+
in self.toolchain.flags.items()}
9696
if config_header:
9797
config_header = relpath(config_header,
9898
self.resources.file_basepath[config_header])
@@ -117,7 +117,7 @@ def toolchain_flags(self, toolchain):
117117
config_header = self.toolchain.get_config_header()
118118

119119
flags = {key + "_flags": copy.deepcopy(value) for key, value
120-
in toolchain.flags.iteritems()}
120+
in toolchain.flags.items()}
121121
if config_header:
122122
config_header = relpath(config_header,
123123
self.resources.file_basepath[config_header])

tools/export/gnuarmeclipse/makefile.targets.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ mbedclean:
66
$(RM) $(SECONDARY_FLASH)$(SECONDARY_SIZE) {{name}}.* linker-script-*.ld
77
-@echo ' '
88

9-
{% for config, data in options.iteritems() %}
9+
{% for config, data in options.items() %}
1010
linker-script-{{config}}.ld: ../{{ld_script}}
1111
{{data.cpp_cmd}} {{data.ld.other}} $< -o $@
1212
{{name}}.elf: linker-script-{{config}}.ld

0 commit comments

Comments
 (0)