introducing the -u flag, which turns on the 'unapproved' mode.

Oh, and just testing it in ListUsers.py :)
pull/4/head
Darksider3 5 years ago
parent 2eeeebdacb
commit 3915843943

@ -6,6 +6,10 @@ import lib.CFG as CFG
if __name__ == "__main__": if __name__ == "__main__":
try: try:
SQLitedb(CFG.REG_FILE) SQLitedb(CFG.REG_FILE)
if CFG.args.unapproved:
print("yes! Only unapproved ones!")
else:
print("Just approved ones")
print("hi") print("hi")
exit(0) exit(0)
except KeyboardInterrupt: except KeyboardInterrupt:

@ -7,9 +7,12 @@ else:
if os.path.isfile(cwd) is False: if os.path.isfile(cwd) is False:
cwd = os.getcwd() + "/applicationsconfig.ini" cwd = os.getcwd() + "/applicationsconfig.ini"
# cwd is now either cwd/applicationsconfig or $TILDE_CONF # cwd is now either cwd/applicationsconfig or $TILDE_CONF
argparser = argparse.ArgumentParser(description='interactive registration formular for tilde platforms') argparser = argparse.ArgumentParser(description='Tilde administration tools')
argparser.add_argument('-c', '--config', default=cwd, argparser.add_argument('-c', '--config', default=cwd,
type=str, help='Path to configuration file', required=False) type=str, help='Path to configuration file', required=False)
# store_true just stores true when the command is supplied, so it doesn't need choices nor types
argparser.add_argument('-u', '--unapproved', default=False, action="store_true",
help='List only unapproved users', required=False)
args = argparser.parse_args() args = argparser.parse_args()
CONF_FILE = args.config CONF_FILE = args.config

Loading…
Cancel
Save