From 60d6e12a4e0b7dadb0212fd26c04bfffbba5ad80 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 26 Jul 2015 13:11:03 +0300 Subject: [PATCH] Display stats --- find_oldest.py => print-stats.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) rename find_oldest.py => print-stats.py (69%) 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] -- 2.39.2