List supported frameworks, SDKs with a new pio platform frameworks command

This commit is contained in:
Ivan Kravets
2017-02-26 17:53:41 +02:00
parent 8f5e23ae95
commit 8f79d865aa
4 changed files with 35 additions and 16 deletions

View File

@ -14,11 +14,13 @@ PlatformIO 3.0
- Recent and popular keywords
- Featured libraries (today, week, month)
* List built-in libraries based on development platforms with
* List built-in libraries based on development platforms with a new
`pio lib builtin <http://docs.platformio.org/page/userguide/lib/cmd_builtin.html>`__ command
* Show detailed info about a library using `pio lib show <http://docs.platformio.org/page/userguide/lib/cmd_show.html>`__
command
(`issue #430 <https://github.com/platformio/platformio-core/issues/430>`_)
* List supported frameworks, SDKs with a new
`pio platform frameworks <http://docs.platformio.org/en/latest/userguide/platforms/cmd_frameworks.htmll>`__ command
* Added new options ``--no-reset``, ``--monitor-rts`` and ``--monitor-dtr``
to `pio test <http://docs.platformio.org/en/latest/userguide/cmd_test.html>`__
command (allows to avoid automatic board's auto-reset when gathering test results)

2
docs

Submodule docs updated: dcdff19342...57f270e475

View File

@ -14,7 +14,7 @@
import sys
VERSION = (3, 3, "0a11")
VERSION = (3, 3, "0a12")
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"

View File

@ -28,15 +28,14 @@ def cli():
def _print_platforms(platforms):
for platform in platforms:
click.echo("{name} ~ {title}".format(
name=click.style(
platform['name'], fg="cyan"),
name=click.style(platform['name'], fg="cyan"),
title=platform['title']))
click.echo("=" * (3 + len(platform['name'] + platform['title'])))
click.echo(platform['description'])
click.echo()
click.echo("Home: %s" % "http://platformio.org/platforms/" +
platform['name'])
if platform['packages']:
if "homepage" in platform:
click.echo("Home: %s" % platform['homepage'])
if "packages" in platform:
click.echo("Packages: %s" % ", ".join(platform['packages']))
if "version" in platform:
click.echo("Version: " + platform['version'])
@ -51,17 +50,13 @@ def platform_search(query, json_output):
for platform in util.get_api_result("/platforms", cache_valid="30d"):
if query == "all":
query = ""
search_data = json.dumps(platform)
if query and query.lower() not in search_data.lower():
continue
platforms.append({
"name": platform['name'],
"title": platform['title'],
"description": platform['description'],
"packages": platform['packages']
})
platform['homepage'] = (
"http://platformio.org/platforms/" + platform['name'])
del platform['version']
platforms.append(platform)
if json_output:
click.echo(json.dumps(platforms))
@ -69,6 +64,27 @@ def platform_search(query, json_output):
_print_platforms(platforms)
@cli.command("frameworks", short_help="List supported frameworks, SDKs")
@click.argument("query", required=False)
@click.option("--json-output", is_flag=True)
def platform_frameworks(query, json_output):
frameworks = []
for framework in util.get_api_result("/frameworks", cache_valid="30d"):
if query == "all":
query = ""
search_data = json.dumps(framework)
if query and query.lower() not in search_data.lower():
continue
framework['homepage'] = (
"http://platformio.org/frameworks/" + framework['name'])
frameworks.append(framework)
if json_output:
click.echo(json.dumps(frameworks))
else:
_print_platforms(frameworks)
@cli.command("install", short_help="Install new development platform")
@click.argument("platforms", nargs=-1, required=True, metavar="[PLATFORM...]")
@click.option("--with-package", multiple=True)
@ -166,6 +182,7 @@ def platform_list(json_output):
"description": p.description,
"version": p.version,
"url": p.vendor_url,
"homepage": p.homepage,
# "packages": p.packages.keys(), # dump all packages
"packages": p.get_installed_packages().keys(),
'forDesktop':