Skip to content
Snippets Groups Projects
Commit 41c1c60a authored by Lene Wasskog's avatar Lene Wasskog
Browse files

feat: Ensure query templates are copied to mapserver dir

parent 9e55ce2f
No related branches found
No related tags found
No related merge requests found
Pipeline #5989 passed
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
# * For Python: See requirements.txt # * For Python: See requirements.txt
import os import os
import shutil
import time import time
import subprocess import subprocess
import glob import glob
...@@ -325,6 +326,7 @@ if __name__ == "__main__": ...@@ -325,6 +326,7 @@ if __name__ == "__main__":
env = Environment(loader=FileSystemLoader(template_dir)) env = Environment(loader=FileSystemLoader(template_dir))
template = env.get_template(template_file_name) template = env.get_template(template_file_name)
output = template.render( output = template.render(
{ {
"model_id": model_id, "model_id": model_id,
...@@ -340,7 +342,11 @@ if __name__ == "__main__": ...@@ -340,7 +342,11 @@ if __name__ == "__main__":
) )
with open(f"{result_mapfile_year_dir}/{model_id}.map", "w") as f: with open(f"{result_mapfile_year_dir}/{model_id}.map", "w") as f:
f.write(output) f.write(output)
# remove_temporary_files()
query_template = os.path.join(home_dir, "mapfile/query_template.xml")
query_template_temperature = os.path.join(home_dir, "mapfile/query_template_temperature.xml")
shutil.copy(query_template, result_mapfile_year_dir)
shutil.copy(query_template_temperature, result_mapfile_year_dir)
end_time = time.time() end_time = time.time()
logging.info( logging.info(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment