2 """Count all and shown files; display the date of oldest file
4 This file is a part of XSetBg.
8 __author__ = "Oleg Broytman <phd@phdru.name>"
9 __copyright__ = "Copyright (C) 2006-2015 PhiloSoft Design"
10 __license__ = "GNU GPL"
13 from time import localtime, asctime
14 from xsetbg_db import xsetbg_db
17 sys.exit("Error: no database found")
19 print "Total files:", xsetbg_db.select().count()
20 print "Shown files:", xsetbg_db.select('last_shown IS NOT NULL').count()
21 last_shown = xsetbg_db.select('last_shown IS NOT NULL',
22 orderBy='last_shown')[0].last_shown
23 print "Oldest:", asctime(localtime(last_shown))