mirror of
https://github.com/toolleeo/cli-apps.git
synced 2024-11-05 06:00:15 +00:00
Added count of number of apps.
This commit is contained in:
parent
5824cc968b
commit
9d65ed3599
@ -26,12 +26,12 @@ def print_apps(cats, apps):
|
||||
print(fmt_app(app))
|
||||
|
||||
|
||||
def fmt_cats(cats):
|
||||
def fmt_cats(cats, apps):
|
||||
newlist = sorted(cats, key=lambda k: k['name'])
|
||||
st = []
|
||||
for cat_item in newlist:
|
||||
category = cat_item["label"]
|
||||
st.append("[{}](#{})".format(cat_item["name"], cat_item["label"]))
|
||||
st.append("[{}](#{}) ({})".format(cat_item["name"], cat_item["label"], len(apps[cat_item["label"]])))
|
||||
return ' | '.join(st)
|
||||
|
||||
|
||||
@ -47,5 +47,5 @@ with open('cli-apps.yaml', 'r') as yf:
|
||||
# print(data)
|
||||
apps = data["apps"]
|
||||
cats = data["categories"]
|
||||
print(summary.format(count_apps(apps), len(cats), fmt_cats(cats)))
|
||||
print(summary.format(count_apps(apps), len(cats), fmt_cats(cats, apps)))
|
||||
print_apps(cats, apps)
|
||||
|
Loading…
Reference in New Issue
Block a user