Skip to content

Commit 7229291

Browse files
committed
Use checked-in VuMark SVG template
1 parent 0826fc0 commit 7229291

File tree

2 files changed

+12
-22
lines changed

2 files changed

+12
-22
lines changed

admin/create_secrets_files.py

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import datetime
77
import os
88
import sys
9-
import tempfile
109
import textwrap
1110
from pathlib import Path
1211
from typing import TYPE_CHECKING
@@ -33,14 +32,7 @@
3332
reraise=True,
3433
)
3534

36-
VUMARK_TEMPLATE_SVG = textwrap.dedent(
37-
text="""\
38-
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512">
39-
<rect x="0" y="0" width="512" height="512" fill="#ffffff" />
40-
<circle cx="256" cy="256" r="144" fill="#000000" />
41-
</svg>
42-
""",
43-
)
35+
VUMARK_TEMPLATE_SVG_FILE_PATH = Path(__file__).with_name("vumark_template.svg")
4436

4537

4638
def _create_and_get_database_details(
@@ -128,19 +120,13 @@ def _create_and_get_vumark_target_id(
128120
vumark_template_name: str,
129121
) -> str:
130122
"""Upload a VuMark template and get its target ID."""
131-
with tempfile.TemporaryDirectory() as temporary_directory:
132-
svg_file_path = Path(temporary_directory) / "template.svg"
133-
svg_file_path.write_text(
134-
data=VUMARK_TEMPLATE_SVG,
135-
encoding="utf-8",
136-
)
137-
upload_result = RETRY_ON_TIMEOUT(vws_web_tools.upload_vumark_template)(
138-
driver=driver,
139-
database_name=vumark_database_name,
140-
svg_file_path=svg_file_path,
141-
template_name=vumark_template_name,
142-
width=100.0,
143-
)
123+
upload_result = RETRY_ON_TIMEOUT(vws_web_tools.upload_vumark_template)(
124+
driver=driver,
125+
database_name=vumark_database_name,
126+
svg_file_path=VUMARK_TEMPLATE_SVG_FILE_PATH,
127+
template_name=vumark_template_name,
128+
width=100.0,
129+
)
144130

145131
if isinstance(upload_result, str):
146132
return upload_result

admin/vumark_template.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)