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
+10 -4
View File
@@ -1,6 +1,12 @@
import plugin
def imread(fname, as_grey=False, dtype=None):
assert fname == 'test.png'
assert as_grey == True
assert dtype == 'i4'
def save(fname, arr):
return fname, arr
def imsave(fname, arr):
assert fname == 'test.png'
assert arr == [1, 2, 3]
plugin.register('test', save=save)
def imshow(arr, plugin_arg=None):
assert arr == [1, 2, 3]
assert plugin_arg == (1, 2)