]> git.phdru.name Git - xsetbg.git/blobdiff - xsetbg.py
Configure path to the database
[xsetbg.git] / xsetbg.py
index f4426ee6f121b8af3c6451345531d583e4e1f5a7..ac55e25f4271ae60c300ead1650c5287e88009a8 100755 (executable)
--- a/xsetbg.py
+++ b/xsetbg.py
@@ -26,7 +26,7 @@ import sys
 from time import time
 
 from xsetbg_conf import xsetbg_dir, xsetbg_conf
-from xsetbg_db import xsetbg_db_name, xsetbg_db
+from xsetbg_db import xsetbg_db
 
 
 def error(error_str, error_code=1):
@@ -116,11 +116,11 @@ os.umask(0066) # octal; -rw-------; make the global persistent dictionary
                # readable only by the user
 
 try:
-   xsetbg_db = shelve.open(os.path.join(xsetbg_dir, xsetbg_db_name), flag='c')
+   xsetbg_db = shelve.open(xsetbg_db_path, flag='c')
 except anydbm.error, msg:
    if str(msg) == "db type could not be determined":
-      os.remove(xsetbg_db_name)
-      xsetbg_db = shelve.open(os.path.join(xsetbg_dir, xsetbg_db_name), flag='c')
+      os.remove(xsetbg_db_path)
+      xsetbg_db = shelve.open(xsetbg_db_path, flag='c')
 
 # Remove old filenames
 old_time = time() - min_delay
@@ -164,7 +164,7 @@ def change(force=False):
    xsetbg_db = None
    try:
       # Reopen the global persistent dictionary
-      xsetbg_db = shelve.open(os.path.join(xsetbg_dir, xsetbg_db_name), 'w')
+      xsetbg_db = shelve.open(xsetbg_db_path, 'w')
 
       timestamp = xsetbg_db.get(timestamp_key)
       current_time = time()