]> git.phdru.name Git - xsetbg.git/blobdiff - dump_db.py
Expand tilde in the database path
[xsetbg.git] / dump_db.py
index c3daada248e2bbd272a16d6f628df6fda4e08ce2..8c80932bb70172da338ae15a8f256c09e9cc3c15 100755 (executable)
@@ -5,24 +5,14 @@ This file is a part of XSetBg.
 
 """
 
-__version__ = "$Revision: 17 $"[11:-2]
-__revision__ = "$Id: print_all.py 17 2007-06-14 10:37:08Z phd $"[5:-2]
-__date__ = "$Date: 2007-06-14 14:37:08 +0400 (Thu, 14 Jun 2007) $"[7:-2]
-
-__author__ = "Oleg Broytman <phd@phd.pp.ru>"
-__copyright__ = "Copyright (C) 2006, 2007 PhiloSoft Design"
+__author__ = "Oleg Broytman <phd@phdru.name>"
+__copyright__ = "Copyright (C) 2006-2014 PhiloSoft Design"
 __license__ = "GNU GPL"
 
-import os, shelve
 from operator import itemgetter
+from xsetbg_db import xsetbg_db
 
-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):
+for key, value in sorted(xsetbg_db.items(), key=itemgetter(1), reverse=1):
    if key.startswith('/'):
       print value, key
-global_db.close()
+xsetbg_db.close()