forked from platformio/platformio-core
Pass a list iterator directly to "any" or "all" functions
This commit is contained in:
1 parent
3caa2a9e8d
commit
2b4b2eb571
8 files changed
+14
-15
No files matched your search
@@ -57,10 +57,9 @@ class LibBuilderFactory(object):
|
||||
|
||||
@staticmethod
|
||||
def get_used_frameworks(env, path):
|
||||
if any([
|
||||
if any(
|
||||
isfile(join(path, fname))
|
||||
for fname in ("library.properties", "keywords.txt")
|
||||
]):
|
||||
for fname in ("library.properties", "keywords.txt")):
|
||||
return ["arduino"]
|
||||
|
||||
if isfile(join(path, "module.json")):
|
||||
@@ -156,7 +155,7 @@ class LibBuilderBase(object):
|
||||
|
||||
@property
|
||||
def include_dir(self):
|
||||
if not all([isdir(join(self.path, d)) for d in ("include", "src")]):
|
||||
if not all(isdir(join(self.path, d)) for d in ("include", "src")):
|
||||
return None
|
||||
return join(self.path, "include")
|
||||
|
||||
|
||||
@@ -114,10 +114,10 @@ def AutodetectUploadPort(*args, **kwargs): # pylint: disable=unused-argument
|
||||
mbed_pages = [
|
||||
join(item['path'], n) for n in ("mbed.htm", "mbed.html")
|
||||
]
|
||||
if any([isfile(p) for p in mbed_pages]):
|
||||
if any(isfile(p) for p in mbed_pages):
|
||||
return item['path']
|
||||
if item['name'] \
|
||||
and any([l in item['name'].lower() for l in msdlabels]):
|
||||
and any(l in item['name'].lower() for l in msdlabels):
|
||||
return item['path']
|
||||
return None
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ def BuildProgram(env):
|
||||
|
||||
# append specified LD_SCRIPT
|
||||
if ("LDSCRIPT_PATH" in env
|
||||
and not any(["-Wl,-T" in f for f in env['LINKFLAGS']])):
|
||||
and not any("-Wl,-T" in f for f in env['LINKFLAGS'])):
|
||||
env.Append(LINKFLAGS=['-Wl,-T"$LDSCRIPT_PATH"'])
|
||||
|
||||
# enable "cyclic reference" for linker
|
||||
|
||||
Reference in new issue
Block a user