]> git.phdru.name Git - xsetbg.git/blobdiff - xsetbg_db.py
Export xsetbg_db_path
[xsetbg.git] / xsetbg_db.py
old mode 100755 (executable)
new mode 100644 (file)
index 4853afb..54bc62e
@@ -1,4 +1,3 @@
-#! /usr/bin/env python
 """XSetBg database
 
 """
@@ -7,16 +6,16 @@ __author__ = "Oleg Broytman <phd@phdru.name>"
 __copyright__ = "Copyright (C) 2014 PhiloSoft Design"
 __license__ = "GNU GPL"
 
-__all__ = ['xsetbg_db']
+__all__ = ['xsetbg_db_path', 'xsetbg_db']
 
 import anydbm
 import os
 import shelve
-from xsetbg_conf import xsetbg_dir, xsetbg_conf
+from xsetbg_conf import xsetbg_conf
 
-xsetbg_db_name = "xsetbg.db"
+xsetbg_db_path = os.path.expanduser(xsetbg_conf.get('xsetbg', 'database'))
 
 try:
-    xsetbg_db = shelve.open(os.path.join(xsetbg_dir, xsetbg_db_name), 'r')
+    xsetbg_db = shelve.open(xsetbg_db_path, 'r')
 except anydbm.error:
     xsetbg_db = None