Plugin Development Guide

Plugin Development

This guide is intended to provide information on how to setup an environment for developing plugins for Editra. For information about how to plugins work and sample code see the Plugin Overview.

Environment Setup

  1. Install all required software.
    • Python 2.5+ (2.6 suggested).
    • wxPython 2.8.3+ Unicode build (latest release suggested)
    • setuptools
  2. Checkout Editra from svn
    svn checkout Editra
  3. Checkout editra-plugins from svn. Check the folder out under Editra/plugins/ in the folder you checked out above.
    svn checkout editra-plugins
  4. Put Editra/plugins into PYTHONPATH environmental variable.
    • OSX/Linux: export PYTHONPATH="$PYTHONPATH:/path/to/Editra/plugins"
    • Windows: Control Panel => System => Advanced => Environmental Variables Then add it to the system variables. C:\\Path\to\Editra\plugins.

Using Development Mode

Editra plugins are required to be bundled into python eggs to be loaded by Editra, but this can become burdensome when developing a plugin since you need to rebundle it each time you make a change to your code. So when developing plugins its best to bundle the egg in develop mode which will create a link to your source and elimintate the need to rebundle between each change to your source code.

To build a plugin in development mode run the following command from your plugins base directory (i.e Editra/plugins/editra-plugins/myplugin/).

python develop --install-dir=../../
This will create a file in 'Editra/plugins/' called MyPlugin.egg-lnk. Now you can simply just run Editra after each change to your plugin to test the results.

Misc Information

  • When developing a plugin keep in mind that the plugin should also be runnable in a binary version of Editra. This means that any imports you use from the standard python library (or exension libraries) need to be available in the plugin or already in use by Editra.