X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=xsetbg_db.py;h=54bc62e3d06f73875de6c1548bd5d2529d4f1aa0;hb=8ac6352062c85457b59fba2967476b1617494d9c;hp=4853afb8f75ba90a2c142020ccd60e84034bd36b;hpb=a337e26c169baecb75197b50db5fd734c39f6187;p=xsetbg.git diff --git a/xsetbg_db.py b/xsetbg_db.py old mode 100755 new mode 100644 index 4853afb..54bc62e --- a/xsetbg_db.py +++ b/xsetbg_db.py @@ -1,4 +1,3 @@ -#! /usr/bin/env python """XSetBg database """ @@ -7,16 +6,16 @@ __author__ = "Oleg Broytman " __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