Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thor77/pluginloader

A simple plugin loader
https://github.com/thor77/pluginloader

Last synced: about 8 hours ago
JSON representation

A simple plugin loader

Awesome Lists containing this project

README

        

PluginLoader
============

A simple plugin loader

Usage
=====

### files/folders:

```
pluginloader.py
main.py
plugins
\plugin1
\__init__.py
\plugin2
\__init__.py
```

### main.py:

```python
from pluginloader import PluginLoader

plugin_path = 'plugins'
plugin_classes = []
for plugin_class in PluginLoader(plugin_path):
cl = plugin_class()
plugin_classes.append(cl)
```

Another Plugin Blueprint
========================

### files/folders:

```
pluginloader.py
main.py
pluginblueprint.py
plugins
\plugin1
\__init__.py
\plugin2
\__init__.py
```

### main.py:

```python
from pluginloader import PluginLoader
from pluginblueprint import MyPluginBlueprint

plugin_path = 'plugins'
plugin_classes = []
for plugin_class in PluginLoader(plugin_path, MyPluginBlueprint):
cl = plugin_class()
plugin_classes.append(cl)
```