Python style formatting

This commit is contained in:
Ivan Kravets committed 2016-10-31 20:05:34 +02:00
1 parent 653f8b87ec
commit a251470ebd
20 files changed
+141 -108

No files matched your search

+2 -3
View File
@@ -67,9 +67,8 @@ commonvars.AddVariables(
DEFAULT_ENV_OPTIONS = dict(
tools=[
"ar", "as", "gcc", "g++", "gnulink",
"platformio", "pioplatform", "piowinhooks",
"piolib", "piotest", "pioupload", "piomisc"
"ar", "as", "gcc", "g++", "gnulink", "platformio", "pioplatform",
"piowinhooks", "piolib", "piotest", "pioupload", "piomisc"
], # yapf: disable
toolpath=[join(util.get_source_dir(), "builder", "tools")],
variables=commonvars,
+7 -6
View File
@@ -51,8 +51,10 @@ class LibBuilderFactory(object):
@staticmethod
def get_used_frameworks(env, path):
if any([isfile(join(path, fname))
for fname in ("library.properties", "keywords.txt")]):
if any([
isfile(join(path, fname))
for fname in ("library.properties", "keywords.txt")
]):
return ["arduino"]
if isfile(join(path, "module.json")):
@@ -71,6 +73,7 @@ class LibBuilderFactory(object):
return ["mbed"]
return []
# pylint: disable=too-many-instance-attributes, too-many-public-methods
@@ -200,10 +203,8 @@ class LibBuilderBase(object):
if self.extra_script:
self.env.SConscript(
realpath(self.extra_script),
exports={
"env": self.env,
"pio_lib_builder": self
})
exports={"env": self.env,
"pio_lib_builder": self})
def _process_dependencies(self, lib_builders):
if not self.dependencies:
+2 -6
View File
@@ -19,12 +19,8 @@ from os.path import join, sep
def ProcessTest(env):
env.Append(
CPPDEFINES=[
"UNIT_TEST", "UNITY_INCLUDE_CONFIG_H"
],
CPPPATH=[
join("$BUILD_DIR", "UnityTestLib")
])
CPPDEFINES=["UNIT_TEST", "UNITY_INCLUDE_CONFIG_H"],
CPPPATH=[join("$BUILD_DIR", "UnityTestLib")])
unitylib = env.BuildLibrary(
join("$BUILD_DIR", "UnityTestLib"),
env.PioPlatform().get_package_dir("tool-unity"))
+6 -4
View File
@@ -146,8 +146,8 @@ def UploadToDisk(_, target, source, env): # pylint: disable=W0613,W0621
fpath = join(env.subst("$BUILD_DIR"), "%s.%s" % (progname, ext))
if not isfile(fpath):
continue
copyfile(fpath, join(
env.subst("$UPLOAD_PORT"), "%s.%s" % (progname, ext)))
copyfile(fpath,
join(env.subst("$UPLOAD_PORT"), "%s.%s" % (progname, ext)))
print "Firmware has been successfully uploaded.\n"\
"(Some boards may require manual hard reset)"
@@ -161,8 +161,10 @@ def CheckUploadSize(_, target, source, env): # pylint: disable=W0613,W0621
sysenv = environ.copy()
sysenv['PATH'] = str(env['ENV']['PATH'])
cmd = [env.subst("$SIZETOOL"), "-B",
str(source[0] if isinstance(target[0], Alias) else target[0])]
cmd = [
env.subst("$SIZETOOL"), "-B",
str(source[0] if isinstance(target[0], Alias) else target[0])
]
result = util.exec_command(cmd, env=sysenv)
if result['returncode'] != 0:
return
+7 -4
View File
@@ -35,8 +35,9 @@ SRC_FILTER_DEFAULT = ["+<*>", "-<.git%s>" % sep, "-<svn%s>" % sep]
def BuildProgram(env):
def _append_pio_macros():
env.AppendUnique(CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format(
*pioversion_to_intstr())])
env.AppendUnique(CPPDEFINES=[
"PLATFORMIO={0:02d}{1:02d}{2:02d}".format(*pioversion_to_intstr())
])
_append_pio_macros()
@@ -130,8 +131,10 @@ def ProcessFlags(env, flags):
# Cancel any previous definition of name, either built in or
# provided with a -D option // Issue #191
undefines = [u for u in env.get("CCFLAGS", [])
if isinstance(u, basestring) and u.startswith("-U")]
undefines = [
u for u in env.get("CCFLAGS", [])
if isinstance(u, basestring) and u.startswith("-U")
]
if undefines:
for undef in undefines:
env['CCFLAGS'].remove(undef)