summaryrefslogtreecommitdiffstats
path: root/fb.py
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-07-06 16:16:01 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-07-06 16:16:01 +0200
commit977392aadcb8efea7d00c248f380ef361a7df1f9 (patch)
treea20671c818ca5a7f60565256cfbebe696bea784f /fb.py
parentaba807b2767b9f04b59f67ec3c56973432bcc690 (diff)
Add statistics to history output
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb.py')
-rwxr-xr-xfb.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/fb.py b/fb.py
index 40735dd..f1c39e2 100755
--- a/fb.py
+++ b/fb.py
@@ -737,6 +737,12 @@ class FBClient:
items = list(items.values())
multipasteItems = list(multipasteItems.values())
+ uniqueSize = dict()
+ for item in items:
+ uniqueSize[item['hash']] = int(item['filesize'])
+
+ totalSize = sum([v for v in uniqueSize.values()])
+
for item in multipasteItems:
item['id'] = item['url_id']
item['filename'] = '%s file(s)' % (len(item['items']))
@@ -759,6 +765,11 @@ class FBClient:
] for i in items]
print_table(itemsTable)
+ print("\n")
+ print("Total sum of your distinct uploads: %s" % (humanize_bytes(totalSize)))
+ print("Total number of uploads (excluding multipastes): %s" % (len(resp['items'])))
+ print("Total number of multipastes: %s" % (len(multipasteItems)))
+
def display_version(self):
print(self.version)