2
# -*- coding: utf-8 -*-
3
#-------------------------------------------------------------------------------
4
# This file is part of the Code_Saturne Solver.
6
# Copyright (C) 2009 EDF
8
# The Code_Saturne Preprocessor is free software; you can redistribute it
9
# and/or modify it under the terms of the GNU General Public License
10
# as published by the Free Software Foundation; either version 2 of
11
# the License, or (at your option) any later version.
13
# The Code_Saturne Preprocessor is distributed in the hope that it will be
14
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public Licence
19
# along with the Code_Saturne Preprocessor; if not, write to the
20
# Free Software Foundation, Inc.,
21
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
#-------------------------------------------------------------------------------
5
#-------------------------------------------------------------------------------
7
# This file is part of Code_Saturne, a general-purpose CFD tool.
9
# Copyright (C) 1998-2011 EDF S.A.
11
# This program is free software; you can redistribute it and/or modify it under
12
# the terms of the GNU General Public License as published by the Free Software
13
# Foundation; either version 2 of the License, or (at your option) any later
16
# This program is distributed in the hope that it will be useful, but WITHOUT
17
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21
# You should have received a copy of the GNU General Public License along with
22
# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
23
# Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
#-------------------------------------------------------------------------------
27
29
# Trick so that one doesn't have to set the PYTHONPATH variable
28
30
cspath = '@pkgpythondir@'
30
# Similar trick for the MEI library
31
# (consistent with autoconf/automake behavior for MEI)
33
from distutils import sysconfig
34
meipath = os.path.join(sysconfig.get_python_lib(0, 0, prefix='@mei_prefix@'),
39
for p in [meipath, cspath]:
40
if os.path.isdir(p) and not p in sys.path:
43
#-------------------------------------------------------------------------------
47
"""Usage: %(prog)s <topic>
61
-h, --help show this help message and exit"""
63
print usage % {'prog':sys.argv[0]}
65
def check_consistency(argv):
66
import cs_check_consistency
67
cs_check_consistency.main(argv)
71
cs_check_mesh.main(argv)
93
def plot_probes(argv):
95
cs_plot_probes.main(argv)
97
#-------------------------------------------------------------------------------
104
commands = {'help':usage, '--help':usage, '-h':usage,
105
'check_consistency':check_consistency,
106
'check_mesh':check_mesh,
112
'plot_probes':plot_probes}
116
if (len(argv) < 1) or (argv[0] not in commands):
120
sys.argv[0] = sys.argv[0] + ' ' + command
121
sys.argv.remove(command)
122
commands[command](argv[1:])
31
if os.path.isdir(cspath) and not cspath in sys.path:
32
sys.path.insert(0, cspath)
34
from cs_script import master_script
36
#-------------------------------------------------------------------------------
38
#-------------------------------------------------------------------------------
40
if __name__ == '__main__':
42
# Retrieve package information (name, version, installation dirs, ...)
43
from cs_package import package
46
# Create an instance of the main script
47
cs = master_script(sys.argv[1:], pkg)
49
retcode = cs.execute()
126
if __name__ == '__main__':
56
#-------------------------------------------------------------------------------
58
#-------------------------------------------------------------------------------