From 8038c52473c74084974d2fa6116bacf8bbee774e Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 19 Oct 2006 18:57:19 +0000 Subject: [PATCH] Print shown files sorted by date. git-svn-id: file:///home/phd/archive/SVN/xsetbg/trunk@16 143022c7-580b-0410-bae3-87f2bf5d3141 --- print_all.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 print_all.py diff --git a/print_all.py b/print_all.py new file mode 100755 index 0000000..19d5a94 --- /dev/null +++ b/print_all.py @@ -0,0 +1,28 @@ +#! /usr/local/bin/python -O +"""Print shown files sorted by date + +This file is a part of XSetBg. + +""" + +__version__ = "$Revision$"[11:-2] +__revision__ = "$Id$"[5:-2] +__date__ = "$Date$"[7:-2] + +__author__ = "Oleg BroytMann " +__copyright__ = "Copyright (C) 2006 PhiloSoft Design" +__license__ = "GNU GPL" + +import os, shelve +from operator import itemgetter + +xsetbg_dir = os.path.join(os.environ["HOME"], "lib", "xsetbg") +os.chdir(xsetbg_dir) + +global_db_name = "xsetbg.db" + +global_db = shelve.open(global_db_name, flag='r') +for key, value in sorted(global_db.items(), key=itemgetter(1), reverse=1): + if key.startswith('/'): + print key +global_db.close() -- 2.39.5