Skip to content

Commit

Permalink
add watermark
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD authored Jun 4, 2024
1 parent eaf29a1 commit 72c4819
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pyflask/manageNeuroconv/manage_neuroconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 72c4819

Please sign in to comment.