Refactor db_connection -> Database

This commit is contained in:
George Lacey 2016-09-20 18:39:37 +01:00
parent 4d60fd4adb
commit bedad8df22

View File

@ -1,6 +1,7 @@
import sqlite3
class db_connection(object):
class Database(object):
def __init__(self, path):
self.conn = sqlite3.connect(path)
@ -29,7 +30,7 @@ class db_connection(object):
def table_exists(self, name):
result = self.conn.execute("""SELECT * FROM sqlite_master
WHERE type='table' AND name=?""", (name,))
if result.fetchone() == None:
if result.fetchone() is None:
return False
else:
return True