Describe plugins using .ini files, so that we don't need to import them to know their capabilities.

This commit is contained in:
Stefan van der Walt
2009-11-03 00:09:31 +02:00
parent 0f2474a9b9
commit 447397dfa3
13 changed files with 176 additions and 165 deletions
+2 -6
View File
@@ -1,10 +1,8 @@
import plugin
from util import prepare_for_display, window_manager, GuiLockError
import numpy as np
import sys
try:
# We try to aquire the gui lock first or else the gui import might
# trample another GUI's PyOS_InputHook.
@@ -47,7 +45,7 @@ else:
# references to it
self.mgr.remove_window(self)
def qt_imshow(arr):
def imshow(arr):
global app
if not app:
@@ -58,11 +56,9 @@ else:
iw = ImageWindow(arr, window_manager)
iw.show()
def qt_show():
def _app_show():
global app
if app and window_manager.has_windows():
app.exec_()
else:
print 'No images to show. See `imshow`.'
plugin.register('qt', show=qt_imshow, appshow=qt_show)