diff --git a/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni.py b/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni.py
index f2be986..576bccf 100644
--- a/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni.py
+++ b/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni.py
@@ -2,7 +2,6 @@ import builtins
import datetime
import json
import os
-import subprocess
import time
from pathlib import Path
@@ -2124,11 +2123,9 @@ class LamNI(TomoQueueMixin, LamNIAlignmentMixin, LamNIOpticsMixin, LamniGuiTools
file.write(
f"\nAt-each-angle hook source ('{self.at_each_angle_hook}'):\n{hook_source}"
)
- # upload_last_pon.sh no longer works and needs a rewrite -- disabled
- # for now (mirrors Flomni, which already has this commented out).
- # subprocess.run(
- # "xterm /work/sls/spec/local/XOMNY/bin/upload/upload_last_pon.sh &", shell=True
- # )
+ # Replaces the old upload_last_pon.sh script (broken, never rewritten --
+ # see git history) with a direct HTTP upload to the samples web folder.
+ self._upload_pdf_report_to_samples(user_target)
# Same tolerance as write_to_scilog(): a session without scilog/logbook
# configured (e.g. a dev/sim session) must not crash report generation
# over the logbook upload -- the PDF itself is already written above.
diff --git a/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/tomo_queue_mixin.py b/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/tomo_queue_mixin.py
index f351f5d..f91f71a 100644
--- a/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/tomo_queue_mixin.py
+++ b/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/tomo_queue_mixin.py
@@ -39,6 +39,7 @@ import builtins
import datetime
import inspect
import json
+import threading
import uuid
from typing import Callable
@@ -390,6 +391,82 @@ class TomoQueueMixin:
user=user,
)
+ # Only omny-test.psi.ch, not v1p0zyg2w9n2k9c1.myfritz.net (the host
+ # TomoIDManager.OMNY_URL registers measurements against, and the
+ # webpage generators mirror their own content to): only
+ # omny-test.psi.ch has the sample counter that actually matches
+ # self.tomo_id.
+ _SAMPLES_UPLOAD_HOSTS = ("https://omny-test.psi.ch",)
+
+ def _upload_pdf_report_to_samples(self, pdf_path: str) -> None:
+ """Upload a just-written PDF report to the OMNY samples web folder
+ (see _SAMPLES_UPLOAD_HOSTS). Identical for every setup that uses
+ ``self.tomo_id`` (set via add_sample_database() just before
+ write_pdf_report() calls this) -- shared here so LamNI/Flomni don't
+ each carry their own copy. Replaces the old, broken
+ upload_last_pon.sh script both used to shell out to.
+
+ POSTs to
")).add_tag( - # ["BEC", "tomo_parameters", f"dataset_id_{dataset_id}", "flOMNI", self.sample_name] - # ) - # self.client.tomo_progress.send_tomo_progress_message("~/data/raw/documentation/tomo_scan_ID_{self.tomo_id}.pdf").send() + # Replaces the old upload_last_pon.sh script (broken, never rewritten) + # with a direct HTTP upload to the samples web folder. + self._upload_pdf_report_to_samples(user_target) import csaxs_bec # Ensure this is a Path object, not a string