fau-fablab / FabLabKasse

FabLabKasse, a Point-of-Sale Software for FabLabs and other public and trust-based workshops
https://fablabkasse.readthedocs.io
GNU General Public License v3.0
15 stars 4 forks source link

Plugin System #135

Open sedrubal opened 8 years ago

sedrubal commented 8 years ago

I think we need something like a plugin system to extend the KassenTerminal with custom plugins (e.g. MagnaCharta Plugin)

Maybe it can work like this:

>>> # in config you can add:
>>> PLUGINS_CFG = [          
...   "plugin1",
...   "plugin2",
...   "sys",  # example
...]
>>> # somewhere in code:
>>> PLUGINS = []
>>> for ps in PLUGINS_CFG:
...     PLUGINS.append(__import__(ps))
>>> # to use them:
>>> for p in PLUGINS:
...    # example usage:
...    print(p.__name__)             
...
plugin1
plugin2
sys
>>>

What do you think?

mgmax commented 8 years ago

it would require a lot more more effort than just this, because plugins need to register their provided things somewhere.