Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LAMBERT Jean-charles
uns_projects
Commits
cac55717
Commit
cac55717
authored
Jun 22, 2017
by
LAMBERT Jean-charles
Browse files
build simulation movies
parent
9155402a
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/mains/post_build_movie.py
0 → 100755
View file @
cac55717
#!/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
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment