From 3b89c13cd251b03ac9bb477a4d8d5d79ebe38171 Mon Sep 17 00:00:00 2001 From: William Ting Date: Tue, 14 May 2013 17:46:28 -0500 Subject: [PATCH] fix stats --- bin/autojump | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/autojump b/bin/autojump index 99e1a86..4f008fe 100755 --- a/bin/autojump +++ b/bin/autojump @@ -305,13 +305,14 @@ def parse_arg(config): sys.exit(0) if (args.stat): - for path, weight in sorted(db.data, key=db.data.get)[-100:]: + for path, weight in sorted(db.data.items(), + key=operator.itemgetter(1))[-100:]: output(unico("%.1f:\t%s") % (weight, path)) print("________________________________________\n") print("%d:\t total key weight" % sum(db.data.values())) - print("%d:\t stored directories" % len(dirs)) - print("db file: %s" % DB_FILE) + print("%d:\t stored directories" % len(db.data)) + print("db file: %s" % config['db']) sys.exit(0)