File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1616
1717import yaml
1818import click
19+ from tabulate import tabulate
1920from flask import Flask , request
2021from requests_oauthlib import OAuth2Session
2122
@@ -153,18 +154,25 @@ def list_folders():
153154 """List all folders"""
154155 client = get_client ()
155156 res = client .get_folders ()
156- print ("unread\t folder" )
157+
158+ output_info = [["Folder" , "Unread Count" ]]
157159 for item in res :
158- print ("{}\t {}" .format (item ['unread_count' ], item ['name' ]))
160+ output_info .append ([item ['name' ], item ['unread_count' ]])
161+
162+ print (tabulate (output_info , headers = 'firstrow' , tablefmt = "github" ))
159163
160164
161165@main .command ("list-tags" )
162166def list_tags ():
163167 """List all tags"""
164168 client = get_client ()
165169 res = client .get_tags ()
170+
171+ output_info = [["Tag" , "Unread Count" ]]
166172 for item in res :
167- print ("{}\t {}" .format (item ['unread_count' ], item ['name' ]))
173+ output_info .append ([item ['name' ], item ['unread_count' ]])
174+
175+ print (tabulate (output_info , headers = 'firstrow' , tablefmt = "github" ))
168176
169177
170178@main .command ("fetch-unread" )
You can’t perform that action at this time.
0 commit comments