mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
YAPF formatter
This commit is contained in:
@ -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:
|
||||
|
@ -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")
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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"):
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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():
|
||||
|
Reference in New Issue
Block a user