From b7ffedfba25e874a635ae41f78a60bae3a452fdd Mon Sep 17 00:00:00 2001 From: Darksider3 Date: Wed, 23 Oct 2019 18:13:42 +0200 Subject: [PATCH] Rename SQLitedb to SQLiteDB --- private/Import.py | 2 +- private/ListUsers.py | 4 ++-- private/editUsers.py | 2 +- private/lib/Validator.py | 2 +- private/lib/sqlitedb.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/private/Import.py b/private/Import.py index a86ee8f..09bd049 100755 --- a/private/Import.py +++ b/private/Import.py @@ -31,7 +31,7 @@ def import_from_file(file_path: str, db: str, user_ids: tuple = tuple([])) -> bo try: with open(file_path, 'r', newline='') as f: import lib.Validator - sql = lib.sqlitedb.SQLitedb(db) + sql = lib.sqlitedb.SQLiteDB(db) err = lib.Validator.checkImportFile(file_path, db) if err is not True: print(err) diff --git a/private/ListUsers.py b/private/ListUsers.py index 3682c07..6f4df02 100755 --- a/private/ListUsers.py +++ b/private/ListUsers.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -from lib.sqlitedb import SQLitedb +from lib.sqlitedb import SQLiteDB import configparser import lib.uis.default as default_cmd # Follows -u, -a, -f flags @@ -20,7 +20,7 @@ class ListUsers: :type approved: bool """ - self.db = SQLitedb(db) + self.db = SQLiteDB(db) if unapproved: # only unapproved users query = "SELECT * FROM `applications` WHERE `status` = '0'" elif approved: # Approved users diff --git a/private/editUsers.py b/private/editUsers.py index c3e200d..77e6096 100755 --- a/private/editUsers.py +++ b/private/editUsers.py @@ -45,7 +45,7 @@ if __name__ == "__main__": if not lib.Validator.checkUserInDB(args.user, db): print(f"User {args.user} does not exist in the database.") exit(1) - DB = lib.sqlitedb.SQLitedb(db) + DB = lib.sqlitedb.SQLiteDB(db) sys_ctl = lib.System.System(args.user) if not DB: print("Could not establish connection to database") diff --git a/private/lib/Validator.py b/private/lib/Validator.py index 2ff39cc..967ce47 100644 --- a/private/lib/Validator.py +++ b/private/lib/Validator.py @@ -71,7 +71,7 @@ def checkUserInDB(username: str, db: str) -> bool: """ try: - ldb = lib.sqlitedb.SQLitedb(db) + ldb = lib.sqlitedb.SQLiteDB(db) fetched = ldb.safequery("SELECT * FROM 'applications' WHERE username = ?", tuple([username])) if fetched: return True diff --git a/private/lib/sqlitedb.py b/private/lib/sqlitedb.py index c51fb2d..1dc1aa0 100644 --- a/private/lib/sqlitedb.py +++ b/private/lib/sqlitedb.py @@ -11,7 +11,7 @@ def dict_factory(cursor, row): return d -class SQLitedb: +class SQLiteDB: """SQLitedb handles EVERYTHING directly related to our Database.""" db = "" @@ -156,7 +156,7 @@ class SQLitedb: if __name__ == "__main__": try: - SQLitedb("bla.db") + SQLiteDB("bla.db") print("hi") exit(0) except KeyboardInterrupt: