forked from platformio/platformio-core
Show owner name for packages
This commit is contained in:
1 parent
2edd7ae649
commit
5cc21511ad
6 files changed
+51
-14
No files matched your search
@@ -450,12 +450,13 @@ def lib_show(library, json_output):
|
||||
if json_output:
|
||||
return click.echo(dump_json_to_unicode(lib))
|
||||
|
||||
click.secho(lib["name"], fg="cyan")
|
||||
click.echo("=" * len(lib["name"]))
|
||||
click.secho("#ID: %d" % lib["id"], bold=True)
|
||||
title = "{ownername}/{name}".format(**lib)
|
||||
click.secho(title, fg="cyan")
|
||||
click.echo("=" * len(title))
|
||||
click.echo(lib["description"])
|
||||
click.echo()
|
||||
|
||||
click.secho("ID: %d" % lib["id"])
|
||||
click.echo(
|
||||
"Version: %s, released %s"
|
||||
% (
|
||||
|
||||
@@ -87,5 +87,8 @@ def save_project_libdeps(project_dir, specs, environments=None, action="add"):
|
||||
pass
|
||||
if action == "add":
|
||||
lib_deps.extend(spec.as_dependency() for spec in specs)
|
||||
config.set("env:" + env, "lib_deps", lib_deps)
|
||||
if lib_deps:
|
||||
config.set("env:" + env, "lib_deps", lib_deps)
|
||||
elif config.has_option("env:" + env, "lib_deps"):
|
||||
config.remove_option("env:" + env, "lib_deps")
|
||||
config.save()
|
||||
@@ -140,6 +140,7 @@ def _get_registry_platform_data( # pylint: disable=unused-argument
|
||||
return None
|
||||
|
||||
data = dict(
|
||||
ownername=_data.get("ownername"),
|
||||
name=_data["name"],
|
||||
title=_data["title"],
|
||||
description=_data["description"],
|
||||
@@ -242,12 +243,11 @@ def platform_show(platform, json_output): # pylint: disable=too-many-branches
|
||||
if json_output:
|
||||
return click.echo(dump_json_to_unicode(data))
|
||||
|
||||
dep = "{ownername}/{name}".format(**data) if "ownername" in data else data["name"]
|
||||
click.echo(
|
||||
"{name} ~ {title}".format(
|
||||
name=click.style(data["name"], fg="cyan"), title=data["title"]
|
||||
)
|
||||
"{dep} ~ {title}".format(dep=click.style(dep, fg="cyan"), title=data["title"])
|
||||
)
|
||||
click.echo("=" * (3 + len(data["name"] + data["title"])))
|
||||
click.echo("=" * (3 + len(dep + data["title"])))
|
||||
click.echo(data["description"])
|
||||
click.echo()
|
||||
if "version" in data:
|
||||
|
||||
@@ -53,6 +53,8 @@ class PackageManagerLegacyMixin(object):
|
||||
if pkg.metadata and pkg.metadata.spec and pkg.metadata.spec.external:
|
||||
manifest["__src_url"] = pkg.metadata.spec.url
|
||||
manifest["version"] = str(pkg.metadata.version)
|
||||
if pkg.metadata and pkg.metadata.spec.owner:
|
||||
manifest["ownername"] = pkg.metadata.spec.owner
|
||||
return manifest
|
||||
|
||||
def legacy_get_installed(self):
|
||||
|
||||
@@ -358,6 +358,12 @@ class ProjectConfigBase(object):
|
||||
click.secho("Warning! %s" % warning, fg="yellow")
|
||||
return True
|
||||
|
||||
def remove_option(self, section, option):
|
||||
return self._parser.remove_option(section, option)
|
||||
|
||||
def remove_section(self, section):
|
||||
return self._parser.remove_section(section)
|
||||
|
||||
|
||||
class ProjectConfigDirsMixin(object):
|
||||
def _get_core_dir(self, exists=False):
|
||||
|
||||
Reference in new issue
Block a user