Apply YAPF

This commit is contained in:
Ivan Kravets
2017-06-05 16:05:05 +03:00
parent 45e75f7473
commit 4d1a135d76
21 changed files with 183 additions and 150 deletions

View File

@@ -366,8 +366,9 @@ def lib_show(library, json_output):
for v in lib['versions']
]))
blocks.append(("Unique Downloads", [
"Today: %s" % lib['dlstats']['day'], "Week: %s" %
lib['dlstats']['week'], "Month: %s" % lib['dlstats']['month']
"Today: %s" % lib['dlstats']['day'],
"Week: %s" % lib['dlstats']['week'],
"Month: %s" % lib['dlstats']['month']
]))
for (title, rows) in blocks:
@@ -418,16 +419,16 @@ def lib_stats(json_output):
click.echo("-" * terminal_width)
def _print_lib_item(item):
click.echo((
printitemdate_tpl if "date" in item else printitem_tpl
).format(
name=click.style(item['name'], fg="cyan"),
date=str(
arrow.get(item['date']).humanize() if "date" in item else ""),
url=click.style(
"http://platformio.org/lib/show/%s/%s" % (item['id'],
quote(item['name'])),
fg="blue")))
click.echo((printitemdate_tpl
if "date" in item else printitem_tpl).format(
name=click.style(item['name'], fg="cyan"),
date=str(
arrow.get(item['date']).humanize()
if "date" in item else ""),
url=click.style(
"http://platformio.org/lib/show/%s/%s" %
(item['id'], quote(item['name'])),
fg="blue")))
def _print_tag_item(name):
click.echo(
@@ -457,8 +458,8 @@ def lib_stats(json_output):
_print_tag_item(item)
click.echo()
for key, title in (("dlday", "Today"), ("dlweek", "Week"),
("dlmonth", "Month")):
for key, title in (("dlday", "Today"), ("dlweek", "Week"), ("dlmonth",
"Month")):
_print_title("Featured: " + title)
_print_header(with_date=False)
for item in result.get(key, []):