From 3472210a8498bcd7d0498450596d3da3e13d1284 Mon Sep 17 00:00:00 2001 From: Q Date: Wed, 13 Aug 2025 21:22:11 +0300 Subject: [PATCH] change plugin system --- tsmark/__init__.py | 2 +- tsmark/video_annotator.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tsmark/__init__.py b/tsmark/__init__.py index f63b2ac..bdf355a 100644 --- a/tsmark/__init__.py +++ b/tsmark/__init__.py @@ -2,7 +2,7 @@ import argparse from tsmark.video_annotator import Marker -VERSION = "0.7.2" +VERSION = "0.7.4" def get_options(): diff --git a/tsmark/video_annotator.py b/tsmark/video_annotator.py index 8938a04..b3ff7de 100755 --- a/tsmark/video_annotator.py +++ b/tsmark/video_annotator.py @@ -597,6 +597,9 @@ class World: def __init__(self, tsmark): self.tsmark = tsmark self.window_name = "tsmark - plugin" + print("plugin loaded") + def __call__(self): + print("plugin called") self.tsmark.paused = True cv2.namedWindow(self.window_name, flags=cv2.WINDOW_AUTOSIZE | cv2.WINDOW_KEEPRATIO | cv2.WINDOW_GUI_NORMAL) frame = cv2.resize(np.zeros((16, 16, 3), dtype=np.uint8), self.tsmark.video_res) @@ -618,12 +621,12 @@ class World: loaded_plugin = importlib.util.module_from_spec(module_spec) module_spec.loader.exec_module(loaded_plugin) plugin_class = getattr(loaded_plugin, plugin_class) - self.plugin = plugin_class + self.plugin = plugin_class(self) def launch_plugin(self): if self.plugin: - self.plugin(self) + self.plugin() def interpolate_points(self, point_index=None): """types: