From 6d48564295c99d76d95b82ca2d4023847a531671 Mon Sep 17 00:00:00 2001 From: Mika Fischer Date: Tue, 7 Jun 2011 18:33:01 +0200 Subject: [PATCH] Add support for plugins bundled with sloth --- sloth/gui/labeltool.py | 3 +++ sloth/plugins/__init__.py | 0 2 files changed, 3 insertions(+) create mode 100644 sloth/plugins/__init__.py diff --git a/sloth/gui/labeltool.py b/sloth/gui/labeltool.py index 559bb91..bc3cd3b 100755 --- a/sloth/gui/labeltool.py +++ b/sloth/gui/labeltool.py @@ -14,6 +14,7 @@ from sloth.gui.annotationscene import * from sloth.gui.frameviewer import * from sloth.gui.controlbuttons import * from sloth.conf import config +from sloth.core.utils import import_callable from sloth import APP_NAME, ORGANIZATION_NAME, ORGANIZATION_DOMAIN, VERSION import okapy.videoio as okv @@ -61,6 +62,8 @@ class MainWindow(QMainWindow): # TODO clean up, make configurable self.plugins_ = [] for plugin in plugins: + if type(plugin) == str: + plugin = import_callable(plugin) p = plugin(self) self.plugins_.append(p) action = p.action() diff --git a/sloth/plugins/__init__.py b/sloth/plugins/__init__.py new file mode 100644 index 0000000..e69de29