fix crash of CLI when no input file specified
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -23,7 +23,7 @@ for engine in engineList:
|
||||
|
||||
allowedFiletypes = [ 'png', 'jpg' ];
|
||||
|
||||
def performChecks ( args, ap, output ):
|
||||
def performChecks ( args, ap ):
|
||||
if ( args.details == None or args.details == '' ):
|
||||
if ( not args.printengines ):
|
||||
if ( not args.version ):
|
||||
@@ -33,6 +33,10 @@ def performChecks ( args, ap, output ):
|
||||
ap.print_usage();
|
||||
return False
|
||||
|
||||
output = args.outputfile;
|
||||
if ( args.outputfile == None or args.outputfile == '' ):
|
||||
output = args.inputfile[ :len( args.inputfile ) - 4 ] + '_upscaled' + args.inputfile[ len( args.inputfile ) - 4: ]
|
||||
|
||||
# check if output file exists and if, prompt user if it should be overwritten and remove if, if yes
|
||||
if ( os.path.exists( output ) ):
|
||||
doReplace = input( '--> File already exists. Do you want to replace it? (Y/n) ' ).lower()
|
||||
@@ -127,11 +131,11 @@ if __name__ == '__main__':
|
||||
|
||||
multiprocessing.freeze_support();
|
||||
|
||||
if ( performChecks( args, ap ) ):
|
||||
output = args.outputfile;
|
||||
if ( args.outputfile == None or args.outputfile == '' ):
|
||||
output = args.inputfile[ :len( args.inputfile ) - 4 ] + '_upscaled' + args.inputfile[ len( args.inputfile ) - 4: ]
|
||||
|
||||
if ( performChecks( args, ap, output ) ):
|
||||
mode = 'fsr'
|
||||
if ( args.mode != None ):
|
||||
mode = args.mode
|
||||
|
||||
Reference in New Issue
Block a user