flaschengeist-schedule/backend/flaschengeist_events/__init__.py

38 lines
971 B
Python
Raw Normal View History

"""Events plugin
Provides duty schedule / duty roster functions
"""
import pkg_resources
from flask import Blueprint, current_app
from werkzeug.local import LocalProxy
from flaschengeist.plugins import Plugin
from . import permissions, models
__version__ = pkg_resources.get_distribution("flaschengeist_events").version
class EventPlugin(Plugin):
2023-04-30 11:55:00 +00:00
# id = "dev.flaschengeist.events"
# provided resources
2023-04-30 11:55:00 +00:00
# permissions = permissions.permissions
models = models
# def __init__(self, cfg):
# super(EventPlugin, self).__init__(cfg)
# from . import routes
# from .event_controller import clear_services
def load(self):
from .routes import blueprint
2023-04-30 11:55:00 +00:00
self.blueprint = blueprint
def install(self):
self.install_permissions(permissions.permissions)
2023-04-30 11:55:00 +00:00
@staticmethod
def getPlugin() -> LocalProxy["EventPlugin"]:
return LocalProxy(lambda: current_app.config["FG_PLUGINS"]["events"])