fix crash of CLI when no input file specified
This commit is contained in:
Binary file not shown.
Binary file not shown.
14
smuL-cli.py
14
smuL-cli.py
@@ -23,7 +23,7 @@ for engine in engineList:
|
|||||||
|
|
||||||
allowedFiletypes = [ 'png', 'jpg' ];
|
allowedFiletypes = [ 'png', 'jpg' ];
|
||||||
|
|
||||||
def performChecks ( args, ap, output ):
|
def performChecks ( args, ap ):
|
||||||
if ( args.details == None or args.details == '' ):
|
if ( args.details == None or args.details == '' ):
|
||||||
if ( not args.printengines ):
|
if ( not args.printengines ):
|
||||||
if ( not args.version ):
|
if ( not args.version ):
|
||||||
@@ -32,6 +32,10 @@ def performChecks ( args, ap, output ):
|
|||||||
print( '\n\n ==> ERROR: Input file required! <==\n\n' )
|
print( '\n\n ==> ERROR: Input file required! <==\n\n' )
|
||||||
ap.print_usage();
|
ap.print_usage();
|
||||||
return False
|
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
|
# check if output file exists and if, prompt user if it should be overwritten and remove if, if yes
|
||||||
if ( os.path.exists( output ) ):
|
if ( os.path.exists( output ) ):
|
||||||
@@ -127,11 +131,11 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
multiprocessing.freeze_support();
|
multiprocessing.freeze_support();
|
||||||
|
|
||||||
output = args.outputfile;
|
if ( performChecks( args, ap ) ):
|
||||||
if ( args.outputfile == None or args.outputfile == '' ):
|
output = args.outputfile;
|
||||||
output = args.inputfile[ :len( args.inputfile ) - 4 ] + '_upscaled' + args.inputfile[ len( args.inputfile ) - 4: ]
|
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'
|
mode = 'fsr'
|
||||||
if ( args.mode != None ):
|
if ( args.mode != None ):
|
||||||
mode = args.mode
|
mode = args.mode
|
||||||
|
|||||||
Reference in New Issue
Block a user