mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-12 12:50:49 +08:00
Describe plugins using .ini files, so that we don't need to import them to know their capabilities.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user