From: Oleg Broytman Date: Sun, 26 Jul 2015 10:11:03 +0000 (+0300) Subject: Display stats X-Git-Tag: v5.0.1~3 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=60d6e12a4e0b7dadb0212fd26c04bfffbba5ad80;p=xsetbg.git Display stats --- diff --git a/find_oldest.py b/print-stats.py similarity index 69% rename from find_oldest.py rename to print-stats.py index 9b94817..a87ad5c 100755 --- a/find_oldest.py +++ b/print-stats.py @@ -1,5 +1,5 @@ #! /usr/bin/env python -"""Count all and shown files; display the date of oldest file +"""Display stats: shown and non-shown files; oldest and newest and so on This file is a part of XSetBg. @@ -18,6 +18,10 @@ if not xsetbg_db: print "Total files:", xsetbg_db.select().count() print "Shown files:", xsetbg_db.select('last_shown IS NOT NULL').count() +print "Not shown files:", xsetbg_db.select('last_shown IS NULL').count() last_shown = xsetbg_db.select('last_shown IS NOT NULL', orderBy='last_shown')[0].last_shown print "Oldest:", asctime(localtime(last_shown)) +min_max = xsetbg_db.select().accumulateMany(('MIN', 'id'), ('MAX', 'id')) +print "Min id:", min_max[0] +print "Max id:", min_max[1]