forked from spyder-ide/spyder
-
Notifications
You must be signed in to change notification settings - Fork 0
Writing Plugins
Joseph Martinot-Lagarde edited this page Jun 21, 2016
·
5 revisions
For general information about plugins, see https://github.com/spyder-ide/spyder/wiki/User-plugins
These third-party plugins may communicate with other Spyder components through the plugin interface (see https://github.com/spyder-ide/spyder/blob/master/spyderlib/plugins/__init__.py).
├── spyder_<PLUGIN_NAME>
├── __init__.py
├── module_a.py
├── images # Resources
├── locale # Translations
└── other_internal_modules
├── __init__.py
How to create your own I/O Spyder plugins:
-
Create a Python module named
spyder_io_foobar
wherefoobar
is the name of your plugin -
Write your loading function and/or your saving function:
-
load
:- input is a string:
filename
- output is a tuple with two elements: dictionary containing at least one element (key is the variable name) and error message (or None)
- input is a string:
-
save
:-
input
is a tuple with two elements:data
(dictionary),filename
-
output
is a string orNone
: error message orNone
if no error occured
-
-
-
Define the global variables
FORMAT_NAME
,FORMAT_EXT
,FORMAT_LOAD
andFORMAT_SAVE
. See the example of DICOM images support: -
More examples of load/save functions may be found here: