6 __author__ = "Oleg Broytman <phd@phdru.name>"
7 __copyright__ = "Copyright (C) 2014 PhiloSoft Design"
8 __license__ = "GNU GPL"
10 __all__ = ['xsetbg_db_path', 'xsetbg_db']
15 from xsetbg_conf import xsetbg_conf
19 xsetbg_db_path = xsetbg_conf.get('xsetbg', 'database')
23 if not xsetbg_db_path:
24 if 'XDG_CACHE_HOME' in os.environ:
25 db_dirs.append(os.environ['XDG_CACHE_HOME'])
26 home_cache = os.path.expanduser('~/.cache')
27 if home_cache not in db_dirs:
28 db_dirs.append(home_cache)
29 db_dirs.append(os.path.dirname(os.path.abspath(__file__)))
32 xsetbg_db_path = os.path.join(d, 'xsetbg.db')
33 if os.path.exists(xsetbg_db_path):
37 xsetbg_db = shelve.open(xsetbg_db_path, 'r')
41 if __name__ == '__main__':
42 print "DB dirs:", db_dirs
43 print "DB file:", xsetbg_db_path