Order the Projects's list by percet key, ref to issue #64

This commit is contained in:
Alessandro Maggio
2020-08-17 12:00:32 +02:00
parent 31bd1fce9e
commit 4c3514af5a
2 changed files with 3 additions and 0 deletions

View File

@@ -329,6 +329,8 @@ def get_waka_time_stats():
if len(data['data']['projects']) == 0:
project_list = no_activity
else:
# Re-order the project list by percentage
data['data']['projects'] = sorted(data['data']['projects'], key=lambda x: x["percent"], reverse=True)
project_list = make_list(data['data']['projects'])
stats = stats + '🐱‍💻 ' + translate['Projects'] + ': \n' + project_list + '\n\n'