From a6f2ae83baceaf4b4d42c936ff09bd0e6df09db9 Mon Sep 17 00:00:00 2001
From: Johannes Nussbaum <39048939+jnussbaum@users.noreply.github.com>
Date: Fri, 23 Feb 2024 13:42:14 +0100
Subject: [PATCH] Fix wrong encodings (#4)
---
.github/workflows/automated-tests.yml | 4 ++--
import_script.py | 6 +++---
test/expected.xml | 6 +++---
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/automated-tests.yml b/.github/workflows/automated-tests.yml
index 3f9e451..53baaf5 100644
--- a/.github/workflows/automated-tests.yml
+++ b/.github/workflows/automated-tests.yml
@@ -14,9 +14,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Install python
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
diff --git a/import_script.py b/import_script.py
index d22cf78..b7f7177 100644
--- a/import_script.py
+++ b/import_script.py
@@ -144,14 +144,14 @@ def main() -> None:
annotation.append(
excel2xml.make_text_prop(
"hasComment",
- "Date and time are invented, like for the other resources.",
+ excel2xml.PropertyElement("Date and time are invented, like for the other resources.", encoding="xml"),
)
)
annotation.append(excel2xml.make_resptr_prop("isAnnotationOf", object_labels_to_ids["Anubis"]))
root.append(annotation)
region = excel2xml.make_region("Region of the Meteorite image", "region_of_meteorite")
- region.append(excel2xml.make_text_prop("hasComment", "This is a comment"))
+ region.append(excel2xml.make_text_prop("hasComment", excel2xml.PropertyElement("This is a comment", encoding="xml")))
region.append(excel2xml.make_color_prop("hasColor", "#5d1f1e"))
region.append(excel2xml.make_resptr_prop("isRegionOf", image2d_labels_to_ids["GibeonMeteorite.jpg"]))
region.append(
@@ -164,7 +164,7 @@ def main() -> None:
root.append(region)
link = excel2xml.make_link("Link between BM1888-0601-716 and Horohoroto", "link_BM1888-0601-716_horohoroto")
- link.append(excel2xml.make_text_prop("hasComment", "This is a comment"))
+ link.append(excel2xml.make_text_prop("hasComment", excel2xml.PropertyElement("This is a comment", encoding="xml")))
link.append(
excel2xml.make_resptr_prop(
"hasLinkTo",
diff --git a/test/expected.xml b/test/expected.xml
index b3d95d2..5a02f32 100644
--- a/test/expected.xml
+++ b/test/expected.xml
@@ -173,7 +173,7 @@
- Date and time are invented, like for the other resources.
+ Date and time are invented, like for the other resources.Anubis_fda7c834-692e-4e2c-b7c8-82e26a2775d9
@@ -181,7 +181,7 @@
- This is a comment
+ This is a comment#5d1f1e
@@ -195,7 +195,7 @@
- This is a comment
+ This is a commentBM1888-0601-716_97f7982b-eaed-4ef2-8813-cb93f8e2c480