https://github.com/times-0/-plugins
An extensible, flexible plugin system written in Python
https://github.com/times-0/-plugins
Last synced: 3 months ago
JSON representation
An extensible, flexible plugin system written in Python
- Host: GitHub
- URL: https://github.com/times-0/-plugins
- Owner: Times-0
- License: gpl-3.0
- Created: 2017-11-20T01:55:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-09T14:55:29.000Z (about 7 years ago)
- Last Synced: 2025-01-17T22:43:06.313Z (5 months ago)
- Language: Python
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# -Plugins
An extensible, flexible plugin system written in Python# Example usage, with requirements
```py
from Plugins.IPlugin import IPlugin, IPluginAbstractMeta
from Example import Exampleclass TestPlugin(IPlugin):
requirements = [
{
"name" : "ExamplePlugin",
"code" : "",
"developer" : "Dote",
"version" : 0
}
]name = "Test Plugin"
def __init__(self, engine):
super(TestPlugin, self).__init__(engine)MyPlugin = TestPlugin(None)
```# Example usgae, with extensibility
```py
from Plugins.IPlugin import IPlugin, IPluginAbstractMeta
from Plugins.Abstract import ExtensibleObject
from Plugins import extend
from Example import Exampleclass Extensible(ExtensibleObject):
extend = True
class Test(IPlugin):
__metaclass__ = IPluginAbstractMeta
@classmethod
def onBuild(cls):
print Receiver.__bases__
extend(Extensible, cls)
extend(Receiver, cls)def cool(self):
print 'cool'# test
a = Extensible()
a.cool()
```