cli output tweaks
This commit is contained in:
parent
043ffbc543
commit
a2e854568f
|
@ -57,7 +57,7 @@ class PhotoApiClient(object):
|
||||||
|
|
||||||
def maybetruncate(s, length):
|
def maybetruncate(s, length):
|
||||||
if s and len(s) > length:
|
if s and len(s) > length:
|
||||||
s = s[0:length - 3] + "..."
|
s = s[0:length - 3].strip() + "..."
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ def main():
|
||||||
|
|
||||||
elif args.action == "stats":
|
elif args.action == "stats":
|
||||||
print(tabulate(sorted([[k, v] for k, v in client.stats().items()],
|
print(tabulate(sorted([[k, v] for k, v in client.stats().items()],
|
||||||
key=lambda row: row[0], reverse=True),
|
key=lambda row: row[0]),
|
||||||
headers=["item", "count"]))
|
headers=["item", "count"]))
|
||||||
|
|
||||||
elif args.action == "user":
|
elif args.action == "user":
|
||||||
|
|
Loading…
Reference in New Issue