|
|
@ -15,13 +15,37 @@ class ListUsers:
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
query = "SELECT * FROM `applications` WHERE status = '0'"
|
|
|
|
query = "SELECT * FROM `applications` WHERE status = '0'"
|
|
|
|
self.usersFetch = self.db.query(query)
|
|
|
|
self.usersFetch = self.db.query(query)
|
|
|
|
print(self.usersFetch)
|
|
|
|
|
|
|
|
|
|
|
|
def getFetch(self):
|
|
|
|
|
|
|
|
return self.usersFetch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
if __name__ == "__main__":
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
L = ListUsers(CFG.args.unapproved)
|
|
|
|
L = ListUsers(CFG.args.unapproved)
|
|
|
|
print("hi")
|
|
|
|
fetch = L.getFetch()
|
|
|
|
|
|
|
|
# MAYBE best solution: https://pypi.org/project/texttable/
|
|
|
|
|
|
|
|
# examle:
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
from texttable import Texttable
|
|
|
|
|
|
|
|
t = Texttable()
|
|
|
|
|
|
|
|
t.add_rows([['Name', 'Age'], ['Alice', 24], ['Bob', 19]])
|
|
|
|
|
|
|
|
print(t.draw())
|
|
|
|
|
|
|
|
---------------> Results in:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+-------+-----+
|
|
|
|
|
|
|
|
| Name | Age |
|
|
|
|
|
|
|
|
+=======+=====+
|
|
|
|
|
|
|
|
| Alice | 24 |
|
|
|
|
|
|
|
|
+-------+-----+
|
|
|
|
|
|
|
|
| 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"]
|
|
|
|
|
|
|
|
))
|
|
|
|
exit(0)
|
|
|
|
exit(0)
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|