Started updates to master migration file. Made update to terminal_helper so prompt no longer provides "skip" option

This commit is contained in:
CocoByte 2023-11-07 15:02:06 -06:00
parent d321b31486
commit a8188cb08f
No known key found for this signature in database
GPG key ID: BBFAA2526384C97F
2 changed files with 20 additions and 6 deletions

View file

@ -95,6 +95,19 @@ class Command(BaseCommand):
)
# The following file arguments have default values for running in the sandbox
# TODO: make this a mandatory argument (if/when we strip out defaults, it will be mandatory)
# TODO: use the migration directory arg or force user to type FULL filepath?
parser.add_argument(
"--migrationJson",
default="/app/management/commands/utility/dataFile.json", # TODO: Get rid of this once done? Or leave it as defaults??
help=(
"A JSON file that holds the location and filenames"
"of all the data files used for migrations"
),
)
# TODO: deprecate this once JSON module is done? (or keep as an override)
parser.add_argument(
"--migrationDirectory",
default="migrationdata",
@ -103,6 +116,8 @@ class Command(BaseCommand):
"load_transition_domain migration script"
),
)
# TODO: deprecate this once JSON module is done? (or keep as an override)
parser.add_argument(
"--migrationFilenames",
default="escrow_domain_contacts.daily.gov.GOV.txt,"

View file

@ -81,7 +81,7 @@ class TerminalHelper:
The "answer" return value is True for "yes" or False for "no".
"""
valid = {"yes": True, "y": True, "ye": True, "no": False, "n": False, "e": "exit", "s": "skip"}
valid = {"yes": True, "y": True, "ye": True, "no": False, "n": False, "e": "exit"}
if default is None:
prompt = " [y/n] "
elif default == "yes":
@ -148,12 +148,13 @@ class TerminalHelper:
"""Create to reduce code complexity.
Prompts the user to inspect the given string
and asks if they wish to proceed.
Returns true if the user responds (y),
Returns false if the user responds (n)"""
If the user responds (y), returns TRUE
If the user responds (n), either returns FALSE
or exits the system if system_exit_on_terminate = TRUE"""
action_description_for_selecting_no = "skip, E = exit"
if system_exit_on_terminate:
action_description_for_selecting_no = "exit, S = skip"
action_description_for_selecting_no = "exit"
# Allow the user to inspect the command string
# and ask if they wish to proceed
@ -176,8 +177,6 @@ class TerminalHelper:
if system_exit_on_terminate:
sys.exit()
return False
if proceed_execution == "skip":
return False
return True
@staticmethod