]> git.phdru.name Git - xsetbg.git/blob - xsetbg_db.py
Open config in xsetbg_conf.py, open db in xsetbg_db.py
[xsetbg.git] / xsetbg_db.py
1 #! /usr/bin/env python
2 """XSetBg database
3
4 """
5
6 __author__ = "Oleg Broytman <phd@phdru.name>"
7 __copyright__ = "Copyright (C) 2014 PhiloSoft Design"
8 __license__ = "GNU GPL"
9
10 __all__ = ['xsetbg_db']
11
12 import anydbm
13 import os
14 import shelve
15 from xsetbg_conf import xsetbg_dir, xsetbg_conf
16
17 xsetbg_db_name = "xsetbg.db"
18
19 try:
20     xsetbg_db = shelve.open(os.path.join(xsetbg_dir, xsetbg_db_name), 'r')
21 except anydbm.error:
22     xsetbg_db = None