Skip to content
Snippets Groups Projects
Commit ad4b9f74 authored by Janet Goldstein's avatar Janet Goldstein
Browse files

WS-640: look for CARTA HTML template in the right place

parent 68de39e8
No related branches found
No related tags found
1 merge request!474WS-640: look for CARTA HTML template in the right place
Pipeline #2758 passed
......@@ -11,5 +11,5 @@ To run carta envoy from command line: example on wirth-vml
1. download image(s) from webtest
2. `ssh vlapipe@wirth-vml`
3. `activate_profile dsoc-dev`
4. cd download location on lustre, e.g., /lustre/aoc/cluster/pipeline/dsoc-dev/spool/820190220
4. cd download location on lustre, e.g., */lustre/aoc/cluster/pipeline/dsoc-dev/spool/820190220*
5. `/lustre/aoc/cluster/pipeline/dsoc-dev/workspaces/sbin/carta_envoy -d ./VLASS1.1.ql.T01t01.J000228-363000.10.2048.v1/rawdata -r true -n jgoldste@nrao.edu`
......@@ -9,6 +9,7 @@ from pathlib import Path
from types import FrameType
from typing import Optional
from carta_envoy.connect import ArchiveConnect, NotificationConnect, RedisConnect
# pylint: disable=R0913, R1721, W0603, W1203
......@@ -165,7 +166,6 @@ class CartaLauncher:
Sends URL notification to user and request handler
:param carta_url: URL to CARTA session
:param carta_html: HTML page with CARTA URL in frame
:return:
"""
......@@ -210,22 +210,26 @@ class CartaLauncher:
:param html_dir: where HTML will be written
:return: HTML file we just created
"""
original_content = self.read_carta_url_template()
new_content = original_content.replace(CARTA_URL_REPLACE_TEXT, carta_url)
template_text = """
<!DOCTYPE html>
<html>
<head title="CARTA Session in a Frame">
<h4 style="color:#006400; font-size:24px;">
Your CARTA Session</h4>
</head>
<body>
<iframe
title="CARTA"
style="position: absolute; height: 100%; border: none"
src="CARTA_URL_GOES_HERE" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%">
</iframe>
</body>
</html>
"""
new_content = template_text.replace(CARTA_URL_REPLACE_TEXT, carta_url)
html_file = html_dir / CARTA_HTML_FILENAME
html_file.write_text(new_content)
return html_file
def read_carta_url_template(self) -> str:
"""
Get contents of carta_url_template.html
:return:
"""
if "rawdata" in self.settings["data_location"]:
path = Path("../carta_url_template.html")
else:
path = Path("carta_url_template.html")
return path.read_text()
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