Update of /cvsroot/modeling/ProjectModeling/Modeling/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv711/scripts
Modified Files:
mdl_validate_model.py
Log Message:
added '-Q' + suppressed logging of warning message when '-w' is supplied
Index: mdl_validate_model.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/scripts/mdl_validate_model.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mdl_validate_model.py 14 Mar 2003 14:35:17 -0000 1.2
--- mdl_validate_model.py 22 Apr 2003 11:08:00 -0000 1.3
***************
*** 59,64 ****
Return status:
! 0 if the model is valide,
! 1 if the model has errors
2 if some warnings were issued (except with --ignore-warnings)
3 in case the model cannot be loaded
--- 59,64 ----
Return status:
! 0 if the model is valid,
! 1 if the model has errors (no matter whether there are warnings)
2 if some warnings were issued (except with --ignore-warnings)
3 in case the model cannot be loaded
***************
*** 66,73 ****
Options:
--------
!
! -q --quiet quiet mode
! -w --ignore-warnings ignore warnings
-h --help gives this help
""" % prgName
sys.stderr.write(_usage)
--- 66,76 ----
Options:
--------
! Default is to print informational, warning and error messages
!
! -q --quiet ignore info, only prints warnings and errors
! -w --ignore-warnings only print errors (see also: Return status above)
! -Q really quiet: do not print anything
-h --help gives this help
+ -v --verbose prints extra info. on the runtime steps
""" % prgName
sys.stderr.write(_usage)
***************
*** 86,90 ****
me=args[0]
try: options, args = getopt.getopt(sys.argv[1:],
! 'hqvw',
["help", "quiet", "verbose",
"ignore-warnings",])
--- 89,93 ----
me=args[0]
try: options, args = getopt.getopt(sys.argv[1:],
! 'hQqvw',
["help", "quiet", "verbose",
"ignore-warnings",])
***************
*** 95,101 ****
for k, v in options:
if k in ('-h', '--help'): usage(me); return 0
! if k in ('-q', '--quiet'): quiet_mode=1; continue
if k in ('-v', '--verbose'): verbose=1; continue
! if k in ('-i', '--ignore_warnings'): ignore_warnings=1; continue
if len(args)!=1: usage(me) ; return 1
--- 98,111 ----
for k, v in options:
if k in ('-h', '--help'): usage(me); return 0
! if k in ('-Q', ): quiet_mode=1; verbose=0; continue
! if k in ('-q', '--quiet'):
! ignore_levels.append(INFO)
! continue
if k in ('-v', '--verbose'): verbose=1; continue
! if k in ('-w', '--ignore_warnings'):
! ignore_levels.append(INFO)
! ignore_levels.append(WARNING)
! ignore_warnings=1
! continue
if len(args)!=1: usage(me) ; return 1
***************
*** 103,106 ****
--- 113,117 ----
model_file=args[0]
# load the model
+ if verbose: log("Loading the model...")
ms=ModelSet()
try:
***************
*** 112,116 ****
log(tracebackInfoFromStack(exc))
return 3
! if verbose: log("Loading the model...")
errors=validate_model(ms.models()[0], ignore_levels)
if verbose: log("Done.")
--- 123,128 ----
log(tracebackInfoFromStack(exc))
return 3
! if verbose: log("Done.")
! if verbose: log("Validating...")
errors=validate_model(ms.models()[0], ignore_levels)
if verbose: log("Done.")
|