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)