gplugin/gplugin
Clone
Summary
Browse
Changes
Graph
Merge develop into default for the release
v0.29.0
2019-11-07, Gary Kramlich
fc9c95c883ae
Merge develop into default for the release
<?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>
<warning>
<para>
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.
</para>
</warning>
<simplesect>
<title>
Example
Python
Plugin
</title>
<para>
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.
</para>
<para>
The
following
is
a
basic
Python
plugin.
<informalexample><programlisting>
import
gi
gi.require_version('GPlugin',
'0.0')
from
gi.repository
import
GPlugin
def
gplugin_plugin_query():
return
GPlugin.PluginInfo(
id='gplugin-python/basic-plugin',
abi_version=0x01020304,
name='basic
plugin',
authors=['author1'],
category='test',
version='version',
license_id='license',
summary='summary',
website='website',
description='description',
)
def
gplugin_plugin_load(plugin):
return
True
def
gplugin_plugin_unload(plugin):
return
True
</programlisting></informalexample>
</para>
</simplesect>
</chapter>