File: README.rst

package info (click to toggle)
python-pluginbase 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 268 kB
  • sloc: python: 537; makefile: 118
file content (33 lines) | stat: -rw-r--r-- 684 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
PluginBase
==========

PluginBase is a module for Python that enables the development of flexible plugin systems in Python.

Step 1:

.. code-block:: python

   from pluginbase import PluginBase
   plugin_base = PluginBase(package='yourapplication.plugins')

Step 2:

.. code-block:: python

   plugin_source = plugin_base.make_plugin_source(
       searchpath=['./path/to/plugins', './path/to/more/plugins'])

Step 3:

.. code-block:: python

   with plugin_source:
       from yourapplication.plugins import my_plugin
   my_plugin.do_something_cool()

Or alternatively:

.. code-block:: python

   my_plugin = plugin_source.load_plugin('my_plugin')
   my_plugin.do_something_cool()