diff --git a/src/pyflask/manageNeuroconv/manage_neuroconv.py b/src/pyflask/manageNeuroconv/manage_neuroconv.py index 22bceede3..9d10d1d55 100644 --- a/src/pyflask/manageNeuroconv/manage_neuroconv.py +++ b/src/pyflask/manageNeuroconv/manage_neuroconv.py @@ -14,7 +14,7 @@ from tqdm_publisher import TQDMProgressHandler -from .info import CONVERSION_SAVE_FOLDER_PATH, GUIDE_ROOT_FOLDER, STUB_SAVE_FOLDER_PATH +from .info import CONVERSION_SAVE_FOLDER_PATH, GUIDE_ROOT_FOLDER, STUB_SAVE_FOLDER_PATH, is_packaged, resource_path from .info.sse import format_sse progress_handler = TQDMProgressHandler() @@ -1000,6 +1000,13 @@ def update_conversion_progress(message): tzinfo=zoneinfo.ZoneInfo(info["timezone"]) ) + # Add GUIDE watermark + package_json_file_path = resource_path("package.json" if is_packaged() else "../../package.json") + with open(file=package_json_file_path) as fp: + package_json = json.load(fp=fp) + app_version = package_json["version"] + resolved_metadata["NWBFile"]["source_script"] = f"Created using NWB GUIDE v{app_version}" + # Actually run the conversion converter.run_conversion( metadata=resolved_metadata,