import salome
import logging
+DisplayEntryInCMD = "--display"
+VerboseEntryInCMD = "--verbose"
+StopOnErrorEntryInCMD = "--stop-on-error"
+DumpOnErrorEntryInCMD = "--dump-on-error"
+DumpEntryInCMD = "--dump"
+KernelTraceEntryInCMD = "--kerneltrace"
+DumpStateEntryInCMD = "--dump-final"
+LoadStateEntryInCMD = "--load-state"
+SaveXMLSchemaEntryInCMD = "--save-xml-schema"
+ShutdownEntryInCMD = "--shutdown"
+ResetEntryInCMD = "--reset"
+InitPortEntryInCMD = "--init-port"
+DoNotSqueezeEntryInCMD = "--donotsqueeze"
IOREntryInCMD = "--ior-ns"
+DisplayKeyInARGS = "display"
+VerboseKeyInARGS = "verbose"
+StopOnErrorKeyInARGS = "stop"
+DumpOnErrorKeyInARGS = "dumpErrorFile"
+DumpKeyInARGS = "dump"
+KernelTraceKeyInARGS = "kerneltrace"
+DumpStateKeyInARGS = "finalDump"
+LoadStateKeyInARGS = "loadState"
+SaveXMLSchemaKeyInARGS = "saveXMLSchema"
+ShutdownKeyInARGS = "shutdown"
+ResetKeyInARGS = "reset"
+InitPortKeyInARGS = "init_port"
+DoNotSqueezeKeyInARGS = "donotsqueeze"
+IOREKeyInARGS = "iorNS"
+
my_runtime_yacs = None
my_ior_ns = None
salome.dsm.shutdownScopes()
my_runtime_yacs.fini( False )
+def toDict( args ):
+ """
+ Convert argparse.Namespace to dict
+ """
+ ATTR = ["display","verbose","stop","dumpErrorFile","dump","kerneltrace","finalDump","loadState","saveXMLSchema","shutdown","reset","init_port","donotsqueeze","iorNS"]
+ return {k:getattr(args,k) for k in ATTR}
+
def reprAfterArgParsing( args ):
"""
Args:
iorNS : {args.iorNS}
"""
+
def getArgumentParser():
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('xmlfilename',help = "XML file containing YACS schema to be executed")
- parser.add_argument("-d", "--display", dest = "display", type=int, default=[0], nargs=1, help="Display dot files: 0=never to 3=very often")
- parser.add_argument("-v", "--verbose", dest = "verbose",help="Produce verbose output", action='store_true')
- parser.add_argument("-s","--stop-on-error",dest="stop",help="Stop on first error", action='store_true')
- parser.add_argument("-e","--dump-on-error",dest="dumpErrorFile", type=str, const='dumpErrorState.xml', default="", nargs='?', help="Stop on first error and dump state")
- parser.add_argument("-g","--dump",dest="dump", type=int, const=60, default=0, nargs='?', help="dump state")
- parser.add_argument("-kt", "--kerneltrace", dest = "kerneltrace",help="Produce verbose of SALOME/KERNEL", action='store_true')
- parser.add_argument("-f","--dump-final", dest ="finalDump", type=str, const='finalDumpState.xml', default="", nargs='?', help="dump final state")
- parser.add_argument("-l","--load-state", dest="loadState", type=str, default="", help="Load State from a previous partial execution")
- parser.add_argument("-x","--save-xml-schema", dest="saveXMLSchema", type=str, const="saveSchema.xml", nargs='?', default="", help = "dump xml schema")
- parser.add_argument("-t","--shutdown", dest = 'shutdown', type=int , default=1, help="Shutdown the schema: 0=no shutdown to 3=full shutdown")
- parser.add_argument("-r","--reset", dest = "reset", type=int , default = 0, help="Reset the schema before execution: 0=nothing, 1=reset error nodes to ready state")
- parser.add_argument("-i","--init-port", dest = 'init_port', type=str, default ="", help="Initialisation value of a port, specified as bloc.node.port=value.")
- parser.add_argument("-z","--donotsqueeze", dest = "donotsqueeze", help = "Desactivate squeeze memory optimization.", action='store_true')
+ parser.add_argument("-d", DisplayEntryInCMD, dest = "display", type=int, default=[0], nargs=1, help="Display dot files: 0=never to 3=very often")
+ parser.add_argument("-v", VerboseEntryInCMD, dest = "verbose",help="Produce verbose output", action='store_true')
+ parser.add_argument("-s",StopOnErrorEntryInCMD,dest="stop",help="Stop on first error", action='store_true')
+ parser.add_argument("-e",DumpOnErrorEntryInCMD,dest="dumpErrorFile", type=str, const='dumpErrorState.xml', default="", nargs='?', help="Stop on first error and dump state")
+ parser.add_argument("-g",DumpEntryInCMD,dest="dump", type=int, const=60, default=0, nargs='?', help="dump state")
+ parser.add_argument("-kt", KernelTraceEntryInCMD, dest = "kerneltrace",help="Produce verbose of SALOME/KERNEL", action='store_true')
+ parser.add_argument("-f",DumpStateEntryInCMD, dest ="finalDump", type=str, const='finalDumpState.xml', default="", nargs='?', help="dump final state")
+ parser.add_argument("-l",LoadStateEntryInCMD, dest="loadState", type=str, default="", help="Load State from a previous partial execution")
+ parser.add_argument("-x",SaveXMLSchemaEntryInCMD, dest="saveXMLSchema", type=str, const="saveSchema.xml", nargs='?', default="", help = "dump xml schema")
+ parser.add_argument("-t",ShutdownEntryInCMD, dest = 'shutdown', type=int , default=1, help="Shutdown the schema: 0=no shutdown to 3=full shutdown")
+ parser.add_argument("-r",ResetEntryInCMD, dest = "reset", type=int , default = 0, help="Reset the schema before execution: 0=nothing, 1=reset error nodes to ready state")
+ parser.add_argument("-i",InitPortEntryInCMD, dest = 'init_port', type=str, default ="", help="Initialisation value of a port, specified as bloc.node.port=value.")
+ parser.add_argument("-z",DoNotSqueezeEntryInCMD = "--donotsqueeze", dest = "donotsqueeze", help = "Desactivate squeeze memory optimization.", action='store_true')
parser.add_argument(IOREntryInCMD, dest = "iorNS", type=str, default ="", help="file inside which the ior of NS will be stored")
return parser
#
if args.iorNS:
my_ior_ns = args.iorNS
+ import pdb
+ pdb.set_trace()
#
if args.verbose:
setVerbose( args.kerneltrace )