forked from platformio/platformio-core
Fix unicode issue when search libraries
This commit is contained in:
@ -127,6 +127,10 @@ def echo_liblist_header():
|
|||||||
|
|
||||||
|
|
||||||
def echo_liblist_item(item):
|
def echo_liblist_item(item):
|
||||||
|
description = item.get("description", item.get("url", "")).encode("utf-8")
|
||||||
|
if "version" in item:
|
||||||
|
description += " | @" + click.style(item['version'], fg="yellow")
|
||||||
|
|
||||||
click.echo(
|
click.echo(
|
||||||
LIBLIST_TPL.format(
|
LIBLIST_TPL.format(
|
||||||
id=click.style(
|
id=click.style(
|
||||||
@ -137,10 +141,9 @@ def echo_liblist_item(item):
|
|||||||
", ".join(
|
", ".join(
|
||||||
item.get("frameworks", ["-"]) + item.get("platforms", [])),
|
item.get("frameworks", ["-"]) + item.get("platforms", [])),
|
||||||
fg="yellow"),
|
fg="yellow"),
|
||||||
authornames=", ".join(item.get("authornames", ["Unknown"])),
|
authornames=", ".join(item.get("authornames", ["Unknown"])).encode(
|
||||||
description=item.get("description", item.get("url", ""))) +
|
"utf-8"),
|
||||||
(" | @" + click.style(
|
description=description))
|
||||||
item['version'], fg="yellow") if "version" in item else ""))
|
|
||||||
|
|
||||||
|
|
||||||
@cli.command("search", short_help="Search for library")
|
@cli.command("search", short_help="Search for library")
|
||||||
|
Reference in New Issue
Block a user