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):
# 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
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()