From cab4cd25a2d8506c09ab0b81d0aca682bb6402f4 Mon Sep 17 00:00:00 2001 From: Darksider3 Date: Sat, 12 Oct 2019 14:21:26 +0200 Subject: [PATCH] Well, that alternative view rocks hard... --- private/ListUsers.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/private/ListUsers.py b/private/ListUsers.py index 1abee08..8314d0f 100644 --- a/private/ListUsers.py +++ b/private/ListUsers.py @@ -16,6 +16,9 @@ class ListUsers: query = "SELECT * FROM `applications` WHERE status = '0'" self.usersFetch = self.db.query(query) + def prettyPrint(self): + pass # see below why not implemented yet, texttable... + def getFetch(self): return self.usersFetch @@ -41,9 +44,16 @@ print(t.draw()) | Bob | 19 | +-------+-----+ - """ + for user in fetch: + print("ID: {}; Username: \"{}\"; Mail: {}; Name: \"{}\"; Registered: {}; Status: {}".format( + user["id"], user["username"], user["email"], user["name"], user["timestamp"], user["status"] + ))""" + print("ID %-1s| Username %-5s| Mail %-20s| Name %-17s| Registered %-8s| State |" % ( + " ", " ", " ", " ", " " + )) + print(101*"-") for user in fetch: - print("ID: {}; Username: \"{}\"; Mail: <{}>; Name: \"{}\"; Registered: {}; Status: {}".format( + print("%-4i| %-14s| %-25s| %-22s| %-8s| %-6i|" % ( user["id"], user["username"], user["email"], user["name"], user["timestamp"], user["status"] )) exit(0)