Rename SQLitedb to SQLiteDB

pull/4/head
Darksider3 5 years ago
parent fb4b577eb8
commit b7ffedfba2

@ -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)

@ -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

@ -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")

@ -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

@ -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:

Loading…
Cancel
Save