Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Analyze Sparrow's Tokyo Cabinet
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/bas.westerbaan@gmail.com.sparrowdb/'+
'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