package documentation
(source)

API documentation of the zim plugin framework.

This file contains the base classes used to write plugins for zim. Each plugin is defined as a sub-module in the "zim.plugins" namespace.

To be recognized as a plugin, a submodule of "zim.plugins" needs to define one (and only one) sub-class of PluginClass. This class will define the main plugin object and contains meta data about the plugin and e.g. plugin preferences.

The plugin object itself doesn't directly interact with the rest of the zim application. To actually add functionality to zim, the plugin module will also need to define one or more "extension" classes. These classes act as decorators for specific objects that appear in the application. They will be instantiated automatically whenever the target object is created. The extension object then has direct access to the API of the object that is being extended.

Each extension object that is instantiated is linked to the plugin object that it belongs to. So it can access functions of the plugin object and it can use the plugin object to find other extension objects if it needs to cooperate.

Also defined here is the PluginManager class. This class is the interface towards the rest of the application to load/unload plugins and to let plugins extend specific application objects.

Package attachmentbrowser Zim plugin to display files in attachments folder.
Package base No package docstring; 1/1 module documented
Package pageindex No package docstring; 0/1 variable, 0/9 constant, 2/6 classes, 0/1 module documented
Package tasklist No package docstring; 0/3 class, 1/3 module documented
Package versioncontrol No package docstring; 0/1 variable, 0/1 constant, 0/1 function, 2/11 classes, 0/4 module documented
Module arithmetic Undocumented
Module backlinkpane Undocumented
Module bookmarksbar No module docstring; 0/1 variable, 0/2 constant, 1/4 class documented
Module commandpalette No module docstring; 0/1 variable, 3/4 classes documented
Module diagrameditor Undocumented
Module distractionfree Undocumented
Module ditaaeditor Undocumented
Module equationeditor Undocumented
Module gnu_r_ploteditor Undocumented
Module gnuplot_ploteditor Undocumented
Module inlinecalculator No module docstring; 0/2 variable, 0/1 constant, 15/18 functions, 0/3 class documented
Module insertsymbol Undocumented
Module journal No module docstring; 0/5 variable, 0/2 constant, 2/2 functions, 3/6 classes documented
Module linesorter Undocumented
Module linkmap Plugin showing a map of links between pages based on GraphViz
Module osx_menubar Undocumented
Module pathbar No module docstring; 0/4 variable, 0/10 constant, 3/13 classes documented
Module printtobrowser Plugin to serve as work-around for the lack of printing support
Module quicknote No module docstring; 0/2 variable, 1/4 class documented
Module scoreeditor Undocumented
Module screenshot Undocumented
Module sequencediagrameditor Undocumented
Module sourceview Undocumented
Module spell Spell check plugin based on gtkspell
Module tableeditor No module docstring; 0/1 variable, 0/5 constant, 1/1 function, 4/6 classes documented
Module tableofcontents No module docstring; 0/1 variable, 0/2 constant, 2/4 functions, 0/8 class documented
Module tags No module docstring; 0/1 variable, 6/9 classes documented
Module toolbar Undocumented
Module trayicon No module docstring; 0/2 variable, 0/2 constant, 0/1 function, 4/6 classes documented
Module zeitgeist-logger Push events to the Zeitgeist daemon

From __init__.py:

Class DialogExtensionBase Base class for extending Gtk dialogs based on Gtk.Dialog @ivar dialog: the Gtk.Dialog object
Class ExtensionBase Base class for all extensions classes @ivar plugin: the plugin object to which this extension belongs @ivar obj: the extendable object
Class InsertedObjectTypeExtension Undocumented
Class InsertedObjectTypeMap No summary
Class PluginClass Base class for plugins objects.
Class PluginManagerClass Manager that maintains a set of active plugins
Function extendable No summary
Function find_action No summary
Function find_extension No summary
Function list_actions List actions Returns list of actions of obj followed by all actions of all of it's extensions. Each action is a 2-tuple of the action and it's name.
Function resetPluginManager Undocumented
Constant PLUGIN_FOLDER Undocumented
Variable logger Undocumented
Class _BootstrapPluginManager Undocumented
Class _MyMeta Undocumented
Variable _bootstrappluginmanager Undocumented
logger = (source)

Undocumented

PLUGIN_FOLDER = (source)

Undocumented

Value
XDG_DATA_HOME.folder('zim/plugins')
_bootstrappluginmanager = (source)

Undocumented

def extendable(*extension_bases, register_after_init=True): (source)
Class decorator to mark a class as "extendable"
Parameters
*extension_basesbase classes for extensions
register_after_initif True the class is registered with the PluginManager directly after it's __init__() method has run. If False the class can call PluginManager.register_new_extendable(self) explicitly whenever ready.
def find_extension(obj, klass): (source)
Lookup an extension object This function allows finding extension classes defined by any plugin. So it can be used to find an defined by the same plugin, but also allows cooperation by other plugins. The lookup uses isinstance(), so abstract classes can be used to define interfaces between plugins if you don't want to depent on the exact implementation class.
Parameters
objthe extended object
klassthe class of the extention object
Returns
a single extension object, if multiple extensions match, the first is returned
Raises
ValueErrorif no extension was found
def find_action(obj, actionname): (source)
Lookup an action method Returns an action method (defined with @action or @toggle_action) for either the object itself, or any of it's extensions. This allows cooperation between plugins by calling actions defined by an other plugin action.
Parameters
objthe extended object
actionnamethe name of the action
Returns
an action method
Raises
ValueErrorif no action was found
def list_actions(obj): (source)
List actions Returns list of actions of obj followed by all actions of all of it's extensions. Each action is a 2-tuple of the action and it's name.
def resetPluginManager(): (source)

Undocumented