]> git.phdru.name Git - xsetbg.git/blob - dump_db.py
xsetbg (DBus version).
[xsetbg.git] / dump_db.py
1 #! /usr/bin/env python
2 """Dump the DB sorted by date
3
4 This file is a part of XSetBg.
5
6 """
7
8 __version__ = "$Revision: 17 $"[11:-2]
9 __revision__ = "$Id: print_all.py 17 2007-06-14 10:37:08Z phd $"[5:-2]
10 __date__ = "$Date: 2007-06-14 14:37:08 +0400 (Thu, 14 Jun 2007) $"[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 value, key
28 global_db.close()