From d1b3e0781eb71bf0c565c29b100b884f34d451cf Mon Sep 17 00:00:00 2001 From: Ruben Manuel Thoms Date: Fri, 25 Sep 2020 15:12:28 +0200 Subject: [PATCH] Changed hard coded temp directory pathes to built-in tempfile gettempdir(). --- .../GrpcInterface/Python/rips/PythonExamples/alter_wbs_plot.py | 3 ++- .../rips/PythonExamples/create_and_export_fracture_model.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/GrpcInterface/Python/rips/PythonExamples/alter_wbs_plot.py b/ApplicationCode/GrpcInterface/Python/rips/PythonExamples/alter_wbs_plot.py index e65c5adad4..654945f24f 100644 --- a/ApplicationCode/GrpcInterface/Python/rips/PythonExamples/alter_wbs_plot.py +++ b/ApplicationCode/GrpcInterface/Python/rips/PythonExamples/alter_wbs_plot.py @@ -1,5 +1,6 @@ # Load ResInsight Processing Server Client Library import rips +import tempfile # Connect to ResInsight instance resinsight = rips.Instance.find() @@ -11,7 +12,7 @@ project = resinsight.project wbsplots = project.descendants(rips.WellBoreStabilityPlot) # Chose a sensible output folder -dirname = "C:/temp" +dirname = tempfile.gettempdir() # Loop through all Well Bore Stability plots for wbsplot in wbsplots: diff --git a/ApplicationCode/GrpcInterface/Python/rips/PythonExamples/create_and_export_fracture_model.py b/ApplicationCode/GrpcInterface/Python/rips/PythonExamples/create_and_export_fracture_model.py index 70281af6fc..afe4e74beb 100644 --- a/ApplicationCode/GrpcInterface/Python/rips/PythonExamples/create_and_export_fracture_model.py +++ b/ApplicationCode/GrpcInterface/Python/rips/PythonExamples/create_and_export_fracture_model.py @@ -1,5 +1,6 @@ # Load ResInsight Processing Server Client Library import rips +import tempfile # Connect to ResInsight instance resinsight = rips.Instance.find() # Example code @@ -36,7 +37,7 @@ time_step = time_steps[len(time_steps) - 1] fracture_model_plot_collection = project.descendants(rips.FractureModelPlotCollection)[0] fracture_model_plot = fracture_model_plot_collection.new_fracture_model_plot(eclipse_case=case, fracture_model=fracture_model, time_step=time_step) -export_folder = "/tmp/" +export_folder = tempfile.gettempdir() fracture_model_plot.export_to_file(directory_path=export_folder)