Issue #69 CSL2XSB always asks for confirmation to proceed

This commit is contained in:
Mat Sutcliffe
2020-08-09 01:44:26 +01:00
parent 73435fb76a
commit 2468f3cd81

View File

@@ -386,14 +386,12 @@ parser.add_argument('--replaceDR', metavar="TEXT", help="Replace dataRef's root
args = parser.parse_args() args = parser.parse_args()
# If called with no argument (e.g. by double-clicking the script) ask the user interactively # ask the user interactively if (s)he likes to work on the current directory.
# if (s)he likes to work on the current directory.
UserWantsIt = None
if args.path == 'NULL': if args.path == 'NULL':
args.path = Path.cwd() args.path = Path.cwd()
print (parser.description) print (parser.description)
print ('Do you want to run CSL2XSB on the current directory "'+str(args.path)+'"?') print ('Do you want to run CSL2XSB on the current directory "'+str(args.path)+'"?')
while True: while True:
UserWantsIt = input ('Answer "y" or "n": ') UserWantsIt = input ('Answer "y" or "n": ')
if UserWantsIt.upper() == 'N': if UserWantsIt.upper() == 'N':
print ('You answered "N", so we exit without doing anything. Try "python CSL2XSBpy -h" for help.') print ('You answered "N", so we exit without doing anything. Try "python CSL2XSBpy -h" for help.')
@@ -413,9 +411,7 @@ if args.verbose:
numConverted = ConvFolder(basePath) numConverted = ConvFolder(basePath)
print ('Done. Converted ' + str(numConverted) + ' OBJ8 files in total. Produced ' + str(_warnings) + ' warning(s).') print ('Done. Converted ' + str(numConverted) + ' OBJ8 files in total. Produced ' + str(_warnings) + ' warning(s).')
# Running interactively? input ("Hit [Enter] to finish.")
if UserWantsIt is not None:
input ("Hit [Enter] to finish.")
# --- Done --- # --- Done ---
exit(0) exit(0)