forked from platformio/platformio-core
YAPF formatter
This commit is contained in:
@ -237,8 +237,10 @@ class LibBuilderBase(object):
|
|||||||
self.env.SConscriptChdir(1)
|
self.env.SConscriptChdir(1)
|
||||||
self.env.SConscript(
|
self.env.SConscript(
|
||||||
realpath(self.extra_script),
|
realpath(self.extra_script),
|
||||||
exports={"env": self.env,
|
exports={
|
||||||
"pio_lib_builder": self})
|
"env": self.env,
|
||||||
|
"pio_lib_builder": self
|
||||||
|
})
|
||||||
|
|
||||||
def _process_dependencies(self):
|
def _process_dependencies(self):
|
||||||
if not self.dependencies:
|
if not self.dependencies:
|
||||||
|
@ -108,8 +108,8 @@ def AutodetectUploadPort(*args, **kwargs): # pylint: disable=unused-argument
|
|||||||
def _look_for_mbed_disk():
|
def _look_for_mbed_disk():
|
||||||
msdlabels = ("mbed", "nucleo", "frdm", "microbit")
|
msdlabels = ("mbed", "nucleo", "frdm", "microbit")
|
||||||
for item in util.get_logicaldisks():
|
for item in util.get_logicaldisks():
|
||||||
if item['disk'].startswith(
|
if item['disk'].startswith("/net") or not _is_match_pattern(
|
||||||
"/net") or not _is_match_pattern(item['disk']):
|
item['disk']):
|
||||||
continue
|
continue
|
||||||
mbed_pages = [
|
mbed_pages = [
|
||||||
join(item['disk'], n) for n in ("mbed.htm", "mbed.html")
|
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 BuildProgram(env):
|
||||||
|
|
||||||
def _append_pio_macros():
|
def _append_pio_macros():
|
||||||
env.AppendUnique(CPPDEFINES=[
|
env.AppendUnique(CPPDEFINES=[("PLATFORMIO", int(
|
||||||
("PLATFORMIO",
|
"{0:02d}{1:02d}{2:02d}".format(*pioversion_to_intstr())))])
|
||||||
int("{0:02d}{1:02d}{2:02d}".format(*pioversion_to_intstr())))
|
|
||||||
])
|
|
||||||
|
|
||||||
_append_pio_macros()
|
_append_pio_macros()
|
||||||
|
|
||||||
|
@ -234,8 +234,8 @@ def lib_search(query, json_output, page, noninteractive, **filters):
|
|||||||
for item in result['items']:
|
for item in result['items']:
|
||||||
print_lib_item(item)
|
print_lib_item(item)
|
||||||
|
|
||||||
if (int(result['page']) * int(result['perpage']) >=
|
if (int(result['page']) * int(result['perpage']) >= int(
|
||||||
int(result['total'])):
|
result['total'])):
|
||||||
break
|
break
|
||||||
|
|
||||||
if noninteractive:
|
if noninteractive:
|
||||||
@ -438,8 +438,8 @@ def lib_stats(json_output):
|
|||||||
printitem_tpl.format(
|
printitem_tpl.format(
|
||||||
name=click.style(name, fg="cyan"),
|
name=click.style(name, fg="cyan"),
|
||||||
url=click.style(
|
url=click.style(
|
||||||
"http://platformio.org/lib/search?query=" + quote(
|
"http://platformio.org/lib/search?query=" +
|
||||||
"keyword:%s" % name),
|
quote("keyword:%s" % name),
|
||||||
fg="blue")))
|
fg="blue")))
|
||||||
|
|
||||||
for key in ("updated", "added"):
|
for key in ("updated", "added"):
|
||||||
|
@ -278,10 +278,10 @@ class EnvironmentProcessor(object):
|
|||||||
if d.strip()
|
if d.strip()
|
||||||
], self.verbose)
|
], self.verbose)
|
||||||
if "lib_deps" in self.options:
|
if "lib_deps" in self.options:
|
||||||
_autoinstall_libdeps(
|
_autoinstall_libdeps(self.cmd_ctx,
|
||||||
self.cmd_ctx,
|
util.parse_conf_multi_values(
|
||||||
util.parse_conf_multi_values(self.options['lib_deps']),
|
self.options['lib_deps']),
|
||||||
self.verbose)
|
self.verbose)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
p = PlatformFactory.newPlatform(self.options['platform'])
|
p = PlatformFactory.newPlatform(self.options['platform'])
|
||||||
@ -323,8 +323,8 @@ def _clean_pioenvs_dir(pioenvs_dir):
|
|||||||
|
|
||||||
# if project's config is modified
|
# if project's config is modified
|
||||||
if (isdir(pioenvs_dir)
|
if (isdir(pioenvs_dir)
|
||||||
and getmtime(join(util.get_project_dir(), "platformio.ini")) >
|
and getmtime(join(util.get_project_dir(),
|
||||||
getmtime(pioenvs_dir)):
|
"platformio.ini")) > getmtime(pioenvs_dir)):
|
||||||
util.rmtree_(pioenvs_dir)
|
util.rmtree_(pioenvs_dir)
|
||||||
|
|
||||||
# check project structure
|
# check project structure
|
||||||
|
@ -32,8 +32,8 @@ def settings_get(name):
|
|||||||
click.echo(
|
click.echo(
|
||||||
list_tpl.format(
|
list_tpl.format(
|
||||||
name=click.style("Name", fg="cyan"),
|
name=click.style("Name", fg="cyan"),
|
||||||
value=(click.style("Value", fg="green") + click.style(
|
value=(click.style("Value", fg="green") +
|
||||||
" [Default]", fg="yellow")),
|
click.style(" [Default]", fg="yellow")),
|
||||||
description="Description"))
|
description="Description"))
|
||||||
click.echo("-" * terminal_width)
|
click.echo("-" * terminal_width)
|
||||||
|
|
||||||
|
@ -87,8 +87,8 @@ WARNING! Don't use `sudo` for the rest PlatformIO commands.
|
|||||||
err=True)
|
err=True)
|
||||||
raise exception.ReturnErrorCode(1)
|
raise exception.ReturnErrorCode(1)
|
||||||
else:
|
else:
|
||||||
raise exception.UpgradeError(
|
raise exception.UpgradeError("\n".join(
|
||||||
"\n".join([str(cmd), r['out'], r['err']]))
|
[str(cmd), r['out'], r['err']]))
|
||||||
|
|
||||||
|
|
||||||
def get_latest_version():
|
def get_latest_version():
|
||||||
|
Reference in New Issue
Block a user