]> git.phdru.name Git - xsetbg.git/blob - print_all.py
xsetbg (DBus version).
[xsetbg.git] / print_all.py
1 #! /usr/bin/env python
2 """Print shown files sorted by date
3
4 This file is a part of XSetBg.
5
6 """
7
8 __version__ = "$Revision$"[11:-2]
9 __revision__ = "$Id$"[5:-2]
10 __date__ = "$Date$"[7:-2]
11
12 __author__ = "Oleg Broytman <phd@phdru.name>"
13 __copyright__ = "Copyright (C) 2006-2010 PhiloSoft Design"
14 __license__ = "GNU GPL"
15
16 import os, shelve
17 from operator import itemgetter
18
19 xsetbg_dir = os.path.join(os.environ["HOME"], "lib", "xsetbg")
20 os.chdir(xsetbg_dir)
21
22 global_db_name = "xsetbg.db"
23
24 global_db = shelve.open(global_db_name, flag='r')
25 for key, value in sorted(global_db.items(), key=itemgetter(1), reverse=1):
26    if key.startswith('/'):
27       print key
28 global_db.close()