Created
August 12, 2012 14:35
-
-
Save bwesterb/3332093 to your computer and use it in GitHub Desktop.
Analyze Sparrow's Tokyo Cabinet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tc | |
import os.path | |
import pprint | |
db = tc.HDB() | |
db.open(os.path.expanduser( | |
'~/Library/Containers/com.sparrowmailapp.sparrow/Data/Library/'+ | |
'Application Support/Sparrow/[email protected]/'+ | |
'data.db/data.tch'), tc.HDBOREADER ) | |
tmp = {} | |
for x in db: | |
if x.split('.')[0] not in tmp: | |
tmp[x.split('.')[0]] = [0,0] | |
tmp[x.split('.')[0]][0] += 1 | |
tmp[x.split('.')[0]][1] += len(db[x]) | |
pprint.pprint(tmp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment