mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 06:45:37 +08:00
Issue #69 CSL2XSB always asks for confirmation to proceed
This commit is contained in:
@@ -386,20 +386,18 @@ 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.')
|
||||||
exit()
|
exit()
|
||||||
if UserWantsIt.upper() == 'Y':
|
if UserWantsIt.upper() == 'Y':
|
||||||
break
|
break
|
||||||
|
|
||||||
# normalize the path, resolves relative paths and makes nice directory delimiters
|
# normalize the path, resolves relative paths and makes nice directory delimiters
|
||||||
basePath = Path(args.path)
|
basePath = Path(args.path)
|
||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user