forked from platformio/platformio-core
Iterating the dictionary directly instead of calling .keys()
This commit is contained in:
@ -86,7 +86,7 @@ MBED_LIBS_MAP = {
|
|||||||
|
|
||||||
def get_mbedlib_includes():
|
def get_mbedlib_includes():
|
||||||
result = []
|
result = []
|
||||||
for lib in MBED_LIBS_MAP.keys():
|
for lib in MBED_LIBS_MAP:
|
||||||
includes = []
|
includes = []
|
||||||
lib_dir = join(env.subst("$PLATFORMFW_DIR"), "libs", lib)
|
lib_dir = join(env.subst("$PLATFORMFW_DIR"), "libs", lib)
|
||||||
for _, _, files in walk(lib_dir):
|
for _, _, files in walk(lib_dir):
|
||||||
|
@ -154,7 +154,7 @@ def ProcessUnFlags(env, flags):
|
|||||||
all_flags.extend(items)
|
all_flags.extend(items)
|
||||||
all_flags = set(all_flags)
|
all_flags = set(all_flags)
|
||||||
|
|
||||||
for key in parsed_flags.keys():
|
for key in parsed_flags:
|
||||||
cur_flags = set(env.get(key, []))
|
cur_flags = set(env.get(key, []))
|
||||||
for item in cur_flags & all_flags:
|
for item in cur_flags & all_flags:
|
||||||
while item in env[key]:
|
while item in env[key]:
|
||||||
|
@ -153,7 +153,7 @@ def lib_install(ctx, libid, version):
|
|||||||
def lib_install_dependency(ctx, data):
|
def lib_install_dependency(ctx, data):
|
||||||
assert isinstance(data, dict)
|
assert isinstance(data, dict)
|
||||||
query = []
|
query = []
|
||||||
for key in data.keys():
|
for key in data:
|
||||||
if key in ("authors", "frameworks", "platforms", "keywords"):
|
if key in ("authors", "frameworks", "platforms", "keywords"):
|
||||||
values = data[key]
|
values = data[key]
|
||||||
if not isinstance(values, list):
|
if not isinstance(values, list):
|
||||||
|
@ -101,7 +101,7 @@ class Upgrader(object):
|
|||||||
prev_platforms = []
|
prev_platforms = []
|
||||||
|
|
||||||
# remove platform's folder (obsolete package structure)
|
# remove platform's folder (obsolete package structure)
|
||||||
for name in PlatformFactory.get_platforms().keys():
|
for name in PlatformFactory.get_platforms():
|
||||||
pdir = join(get_home_dir(), name)
|
pdir = join(get_home_dir(), name)
|
||||||
if not isdir(pdir):
|
if not isdir(pdir):
|
||||||
continue
|
continue
|
||||||
@ -234,7 +234,7 @@ def check_internal_updates(ctx, what):
|
|||||||
|
|
||||||
outdated_items = []
|
outdated_items = []
|
||||||
if what == "platforms":
|
if what == "platforms":
|
||||||
for platform in PlatformFactory.get_platforms(installed=True).keys():
|
for platform in PlatformFactory.get_platforms(installed=True):
|
||||||
p = PlatformFactory.newPlatform(platform)
|
p = PlatformFactory.newPlatform(platform)
|
||||||
if p.is_outdated():
|
if p.is_outdated():
|
||||||
outdated_items.append(platform)
|
outdated_items.append(platform)
|
||||||
|
@ -326,7 +326,7 @@ def backup_reports(items):
|
|||||||
|
|
||||||
for params in items:
|
for params in items:
|
||||||
# skip static options
|
# skip static options
|
||||||
for key in params.keys():
|
for key in params:
|
||||||
if key in ("v", "tid", "cid", "cd1", "cd2", "sr", "an"):
|
if key in ("v", "tid", "cid", "cd1", "cd2", "sr", "an"):
|
||||||
del params[key]
|
del params[key]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user