From f06d4fa94563b7a14200054eb91fe4694e438c43 Mon Sep 17 00:00:00 2001 From: Darksider3 Date: Sat, 12 Oct 2019 13:34:01 +0200 Subject: [PATCH] first steps towards real listings! --- private/ListUsers.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/private/ListUsers.py b/private/ListUsers.py index 81bf72d..423be6e 100644 --- a/private/ListUsers.py +++ b/private/ListUsers.py @@ -3,13 +3,24 @@ from lib.sqlitedb import SQLitedb import lib.CFG as CFG + +class ListUsers: + db = None + usersFetch = None + + def __init__(self, ap: bool): + self.db = SQLitedb(CFG.REG_FILE) + if not ap: + query = "SELECT * FROM `applications` WHERE status = '1'" + else: + query = "SELECT * FROM `applications` WHERE status = '0'" + self.usersFetch = self.db.query(query) + print(self.usersFetch) + + if __name__ == "__main__": try: - SQLitedb(CFG.REG_FILE) - if CFG.args.unapproved: - print("yes! Only unapproved ones!") - else: - print("Just approved ones") + L = ListUsers(CFG.args.unapproved) print("hi") exit(0) except KeyboardInterrupt: