YAPF formatter

This commit is contained in:
Ivan Kravets
2017-11-01 14:10:32 +02:00
parent 86de58b9e1
commit e5e5ebb7db
7 changed files with 22 additions and 22 deletions

View File

@ -237,8 +237,10 @@ class LibBuilderBase(object):
self.env.SConscriptChdir(1)
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):
if not self.dependencies:

View File

@ -108,8 +108,8 @@ def AutodetectUploadPort(*args, **kwargs): # pylint: disable=unused-argument
def _look_for_mbed_disk():
msdlabels = ("mbed", "nucleo", "frdm", "microbit")
for item in util.get_logicaldisks():
if item['disk'].startswith(
"/net") or not _is_match_pattern(item['disk']):
if item['disk'].startswith("/net") or not _is_match_pattern(
item['disk']):
continue
mbed_pages = [
join(item['disk'], n) for n in ("mbed.htm", "mbed.html")

View File

@ -35,10 +35,8 @@ SRC_FILTER_DEFAULT = ["+<*>", "-<.git%s>" % sep, "-<svn%s>" % sep]
def BuildProgram(env):
def _append_pio_macros():
env.AppendUnique(CPPDEFINES=[
("PLATFORMIO",
int("{0:02d}{1:02d}{2:02d}".format(*pioversion_to_intstr())))
])
env.AppendUnique(CPPDEFINES=[("PLATFORMIO", int(
"{0:02d}{1:02d}{2:02d}".format(*pioversion_to_intstr())))])
_append_pio_macros()

View File

@ -234,8 +234,8 @@ def lib_search(query, json_output, page, noninteractive, **filters):
for item in result['items']:
print_lib_item(item)
if (int(result['page']) * int(result['perpage']) >=
int(result['total'])):
if (int(result['page']) * int(result['perpage']) >= int(
result['total'])):
break
if noninteractive:
@ -438,8 +438,8 @@ def lib_stats(json_output):
printitem_tpl.format(
name=click.style(name, fg="cyan"),
url=click.style(
"http://platformio.org/lib/search?query=" + quote(
"keyword:%s" % name),
"http://platformio.org/lib/search?query=" +
quote("keyword:%s" % name),
fg="blue")))
for key in ("updated", "added"):

View File

@ -278,10 +278,10 @@ class EnvironmentProcessor(object):
if d.strip()
], self.verbose)
if "lib_deps" in self.options:
_autoinstall_libdeps(
self.cmd_ctx,
util.parse_conf_multi_values(self.options['lib_deps']),
self.verbose)
_autoinstall_libdeps(self.cmd_ctx,
util.parse_conf_multi_values(
self.options['lib_deps']),
self.verbose)
try:
p = PlatformFactory.newPlatform(self.options['platform'])
@ -323,8 +323,8 @@ def _clean_pioenvs_dir(pioenvs_dir):
# if project's config is modified
if (isdir(pioenvs_dir)
and getmtime(join(util.get_project_dir(), "platformio.ini")) >
getmtime(pioenvs_dir)):
and getmtime(join(util.get_project_dir(),
"platformio.ini")) > getmtime(pioenvs_dir)):
util.rmtree_(pioenvs_dir)
# check project structure

View File

@ -32,8 +32,8 @@ def settings_get(name):
click.echo(
list_tpl.format(
name=click.style("Name", fg="cyan"),
value=(click.style("Value", fg="green") + click.style(
" [Default]", fg="yellow")),
value=(click.style("Value", fg="green") +
click.style(" [Default]", fg="yellow")),
description="Description"))
click.echo("-" * terminal_width)

View File

@ -87,8 +87,8 @@ WARNING! Don't use `sudo` for the rest PlatformIO commands.
err=True)
raise exception.ReturnErrorCode(1)
else:
raise exception.UpgradeError(
"\n".join([str(cmd), r['out'], r['err']]))
raise exception.UpgradeError("\n".join(
[str(cmd), r['out'], r['err']]))
def get_latest_version():