From bedad8df228a900011d6ae181bc83dc1ae16f601 Mon Sep 17 00:00:00 2001 From: George Lacey Date: Tue, 20 Sep 2016 18:39:37 +0100 Subject: [PATCH] Refactor db_connection -> Database --- Database.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Database.py b/Database.py index 4ece1cd..2ebbefd 100644 --- a/Database.py +++ b/Database.py @@ -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