Commit cac55717 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles
Browse files

build simulation movies

parent 9155402a
#!/usr/bin/env python
from __future__ import print_function
import sys
#sys.path=['/home/jcl/works/GIT/uns_projects/py/modules/','/home/jcl/works/GIT/uns_projects/py/modules/simulations']+sys.path
from simulations.cmovie import *
import argparse
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# commandLine, parse the command line
def commandLine():
dbname=None
# help
parser = argparse.ArgumentParser(description="Build simulation movie after smart analysis",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
# options
parser.add_argument('simname', help='Simulation name')
parser.add_argument('--dbname',help='UNS database file name', default=dbname)
parser.add_argument('--verbose',help='verbose mode on', dest="verbose", action="store_true", default=False)
parser.add_argument('--overwrite',help='overwrite file if exist', dest="overwrite", action="store_true", default=False)
parser.add_argument('--ncores', help='#cores used, 0 means all',default=4,type=int)
#parser.add_argument('--no-verbose',help='verbose mode off', dest="verbose", action="store_false", default=True)
# parse
args = parser.parse_args()
# start main funciton
process(args)
# -----------------------------------------------------
# process, is the core function
def process(args):
movie = CMovie(verbose_debug=args.verbose)
try:
movie.buildMovie(args.simname,args.overwrite,args.ncores)
pass
except Exception as x :
print(x.message)
sys.exit()
# -----------------------------------------------------
# main program
if __name__ == '__main__':
commandLine()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment