2 """Display stats: shown and non-shown files; oldest and newest and so on
4 This file is a part of XSetBg.
9 from time import localtime, asctime
10 from xsetbg_db import xsetbg_db
13 sys.exit("Error: no database found")
15 print "Total files:", xsetbg_db.select().count()
16 print "Shown files:", xsetbg_db.select('last_shown IS NOT NULL').count()
17 print "Not shown files:", xsetbg_db.select('last_shown IS NULL').count()
18 last_shown = xsetbg_db.select('last_shown IS NOT NULL',
19 orderBy='last_shown')[0].last_shown
20 print "Oldest:", asctime(localtime(last_shown))
21 min_max = xsetbg_db.select().accumulateMany(('MIN', 'id'), ('MAX', 'id'))
22 print "Min id:", min_max[0]
23 print "Max id:", min_max[1]