1
#-------------------------------------------------------------------------------
2
# This file is part of the Code_Saturne Solver.
4
# Copyright (C) 2009 EDF
6
# The Code_Saturne Preprocessor is free software; you can redistribute it
7
# and/or modify it under the terms of the GNU General Public License
8
# as published by the Free Software Foundation; either version 2 of
9
# the License, or (at your option) any later version.
11
# The Code_Saturne Preprocessor is distributed in the hope that it will be
12
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public Licence
17
# along with the Code_Saturne Preprocessor; if not, write to the
18
# Free Software Foundation, Inc.,
19
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#-------------------------------------------------------------------------------
25
from cs_exec_environment import run_command
26
from optparse import OptionParser
28
#-------------------------------------------------------------------------------
30
def process_cmd_line(argv):
32
Processes the passed command line arguments.
35
arg -- This can be either a list of arguments as in
36
sys.argv[1:] or a string that is similar to the one
37
passed on the command line. If it is a string the
38
string is split to create a list of arguments.
41
parser = OptionParser(usage="Usage: %prog <monitoring file>")
43
(options, args) = parser.parse_args(argv)
53
#-------------------------------------------------------------------------------
57
Plot a monitoring file with XmGrace.
61
# Create a temporary file and correctly format the monitoring file
63
temp_file = tempfile.mkstemp(suffix=".hst")
65
cmd = "grep -v '#'" + " " + str(f) + "|cut -c9- >" + " " + temp_file[1]
68
# Run XmGrace -nxy command
70
cmd = "xmgrace -geometry 1100x850 -nxy" + " " + temp_file[1]
75
os.remove(temp_file[1])
79
#-------------------------------------------------------------------------------
86
file = process_cmd_line(argv)
92
if __name__ == '__main__':