]> git.phdru.name Git - xsetbg.git/blob - xsetbg_db.py
d98e1b5a3ce0cc71fbd5f9eb1ec80b2abb64d0b3
[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 shelve
14 from xsetbg_conf import xsetbg_conf
15
16 xsetbg_db_path = xsetbg_conf.get('xsetbg', 'database')
17
18 try:
19     xsetbg_db = shelve.open(xsetbg_db_path, 'r')
20 except anydbm.error:
21     xsetbg_db = None