From 192e70e4a2e6975525d14ad2f522c099ddcaa85f Mon Sep 17 00:00:00 2001 From: Darksider3 Date: Sat, 19 Oct 2019 13:53:21 +0200 Subject: [PATCH] Seperate out even more, own dir for UIs default UI is now in private/lib/uis/default.py --- private/lib/CFG.py | 3 +-- private/lib/uis/config_ui.py | 6 ++++++ private/lib/{default_cmd.py => uis/default.py} | 13 +++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 private/lib/uis/config_ui.py rename private/lib/{default_cmd.py => uis/default.py} (77%) diff --git a/private/lib/CFG.py b/private/lib/CFG.py index dd5c1fa..bb10f35 100644 --- a/private/lib/CFG.py +++ b/private/lib/CFG.py @@ -1,7 +1,6 @@ -import argparse import configparser import logging -import lib.default_cmd as default_cmd +import lib.uis.default as default_cmd args = default_cmd.argparser.parse_args() CONF_FILE = args.config diff --git a/private/lib/uis/config_ui.py b/private/lib/uis/config_ui.py new file mode 100644 index 0000000..28fb370 --- /dev/null +++ b/private/lib/uis/config_ui.py @@ -0,0 +1,6 @@ +import argparse +import lib.cwd + +argparser = argparse.ArgumentParser(description='Tilde administration tools') +argparser.add_argument('-c', '--config', default=lib.cwd.cwd, + type=str, help='Path to configuration file', required=False) diff --git a/private/lib/default_cmd.py b/private/lib/uis/default.py similarity index 77% rename from private/lib/default_cmd.py rename to private/lib/uis/default.py index 7572b68..38f9b8f 100644 --- a/private/lib/default_cmd.py +++ b/private/lib/uis/default.py @@ -1,10 +1,7 @@ -import argparse -import configparser -import logging -import lib.cwd -argparser = argparse.ArgumentParser(description='Tilde administration tools') -argparser.add_argument('-c', '--config', default=lib.cwd.cwd, - type=str, help='Path to configuration file', required=False) +import lib.uis.config_ui + +argparser = lib.uis.config_ui.argparser + # 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='only unapproved users. Default is only approved.', required=False) @@ -16,4 +13,4 @@ argparser.add_argument('--Import', default=False, action="store_true", help="Import Users from file. Affects currently only Import.py.\n" "Setting this to true will result in -f being interpreted as the input file to import " "users from. The file MUST be a comma separated CSV file being readable having it's " - "defined columns written in the first line.") \ No newline at end of file + "defined columns written in the first line.")