]> rtime.felk.cvut.cz Git - hubacji1/coffee-getter.git/blob - cbdb.py
Refactor to width of 80
[hubacji1/coffee-getter.git] / cbdb.py
1 # -*- coding: utf-8 -*-
2 """Database access."""
3 from sqlite3 import connect
4 from cbconf import Conf
5
6 class Db:
7     def __init__(self, dbpath=False):
8         if dbpath:
9             self.con = connect(dbpath)
10         else:
11             cfg = Conf()
12             self.con = connect(cfg.getCoffeeDbPath())
13         self.cur = self.con.cursor()
14         return None
15
16     def __del__(self):
17         self.con.close()