Changeset 1271 in lmdz_wrf for trunk


Ignore:
Timestamp:
Nov 7, 2016, 6:04:15 PM (8 years ago)
Author:
lfita
Message:

Including error messages when any operation or file is provided

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var.py

    r1237 r1271  
    228228oper=opts.operation
    229229
     230if opts.operation is None:
     231    print errormsg
     232    print '  No operation provided !!'
     233    print "  an operation must be provided as '-o [operationname]' "
     234    quit(-1)
     235
    230236if opts.ncfile is not None and not os.path.isfile(opts.ncfile) and                   \
    231237  not gen.searchInlist(NotCheckingFile,oper):
    232238    print errormsg
    233239    print '  File ' + opts.ncfile + ' does not exist !!'
     240    quit(-1)
     241elif opts.ncfile is None and not gen.searchInlist(NotCheckingFile,oper):
     242    print errormsg
     243    print '  No file provided !!'
     244    print "  a file must be provided as '-f [filename]' "
    234245    quit(-1)
    235246
Note: See TracChangeset for help on using the changeset viewer.