Skip to content
Snippets Groups Projects
Commit 3bff8b05 authored by Thomas Fetzer's avatar Thomas Fetzer
Browse files

[postprocessing] Catch missing module, add colored help message indicating use of pvpython

parent 05d037d1
No related branches found
No related tags found
4 merge requests!600[WIP][components][plotproperties] Add a source file to plot properties of some components,!501Freeflow/turbulenceproperties,!492Resolve "Inconsistent `index()` method of the different `SubControlVolume` classes",!443[postprocessing] Add colored help message indicating use of pvpython
......@@ -5,10 +5,9 @@ import os
# parse arguments
parser = argparse.ArgumentParser(
prog='pvpython ' + sys.argv[0],
prog='\033[1m\033[94m' + 'pvpython' + '\033[0m' + ' ' + sys.argv[0],
description='Extract data from the paraview plotOverLine filter.'
)
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--files', nargs='+', required=True, help="vtu files to be processed")
parser.add_argument('-o', '--outputDirectory', default='', help="Directory to which the data files are written")
parser.add_argument('-of', '--outFile', default='', help="Basename of the written csv file")
......@@ -18,7 +17,10 @@ parser.add_argument('-r', '--resolution', type=int, default=1000, help='Resoluti
parser.add_argument('-v', '--verbosity', type=int, default=2, help='Verbosity of the output. 1 = print progress. 2 = print data columns')
args = vars(parser.parse_args())
from paraview.simple import *
try:
from paraview.simple import *
except ImportError:
print("`paraview.simple` not found. Make sure using pvpython instead of python.")
# import locations
commonOutDirectory = False
......
......@@ -6,7 +6,7 @@ import sys
# parse arguments
parser = argparse.ArgumentParser(
prog='pvpython ' + sys.argv[0],
prog='\033[1m\033[94m' + 'pvpython' + '\033[0m' + ' ' + sys.argv[0],
description='Extract data from the paraview probeLocation and plotOverTime filters.'
)
parser.add_argument('-f', '--files', nargs='+', required=True, help="pvd files to be processed")
......@@ -16,7 +16,10 @@ parser.add_argument('-p', '--point', type=float, nargs=3, required=True, help='C
parser.add_argument('-v', '--verbosity', type=int, default=2, help='Verbosity of the output. 1 = print progress. 2 = print data columns')
args = vars(parser.parse_args())
from paraview.simple import *
try:
from paraview.simple import *
except ImportError:
print("`paraview.simple` not found. Make sure using pvpython instead of python.")
# import locations
commonOutDirectory = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment