<?xml version='1.0' encoding="UTF-8"?> <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ <chapter id="chapter-python"> <title>Python
Plugins
</title> You
<emphasis role="strong">MUST
</emphasis> have
the
Python
loader
plugin
installed
and
working
as
well
as
the
gobject-introspection
package
for
GPlugin
installed
to
use
Python
plugins.
<title>Example
Python
Plugin
</title> Like
all
plugins
in
GPlugin,
Python
plugins
must
also
implement
the
<code>gplugin_query
</code>,
<code>gplugin_load
</code>,
and
<code>gplugin_unload
</code> functions.
The
following
is
a
basic
Python
plugin.
<informalexample><programlisting> gi.require_version("GPlugin",
"0.0")
from
gi.repository
import
GPlugin
def
gplugin_plugin_query():
return
GPlugin.PluginInfo(
id="gplugin-python/basic-plugin",
description="description",
def
gplugin_plugin_load(plugin):
def
gplugin_plugin_unload(plugin):
</programlisting></informalexample>