2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00
Oliver ebcb9685b5 Updates to samplepanel plugin
- Enhanced content for "hello world" panel
- Add an optional panel which breaks rendering
2022-05-19 10:04:20 +10:00

24 lines
562 B
Python

"""
Sample plugin which responds to events
"""
from plugin import InvenTreePlugin
from plugin.mixins import EventMixin
class EventPluginSample(EventMixin, InvenTreePlugin):
"""
A sample plugin which provides supports for triggered events
"""
NAME = "EventPlugin"
SLUG = "sampleevent"
TITLE = "Triggered Events"
def process_event(self, event, *args, **kwargs):
""" Custom event processing """
print(f"Processing triggered event: '{event}'")
print("args:", str(args))
print("kwargs:", str(kwargs))