2021-11-28 21:30:15 +00:00
|
|
|
"""Events plugin
|
|
|
|
|
|
|
|
Provides duty schedule / duty roster functions
|
|
|
|
"""
|
2021-12-23 02:24:12 +00:00
|
|
|
import pkg_resources
|
2021-11-28 21:30:15 +00:00
|
|
|
from flask import Blueprint, current_app
|
|
|
|
from werkzeug.local import LocalProxy
|
|
|
|
|
|
|
|
from flaschengeist.plugins import Plugin
|
|
|
|
from . import permissions, models
|
|
|
|
|
|
|
|
|
2021-12-23 02:24:12 +00:00
|
|
|
__version__ = pkg_resources.get_distribution("flaschengeist_events").version
|
|
|
|
|
|
|
|
|
2021-11-28 21:30:15 +00:00
|
|
|
class EventPlugin(Plugin):
|
2023-04-30 11:55:00 +00:00
|
|
|
# id = "dev.flaschengeist.events"
|
2021-12-23 02:24:12 +00:00
|
|
|
# provided resources
|
2023-04-30 11:55:00 +00:00
|
|
|
# permissions = permissions.permissions
|
2021-11-28 21:30:15 +00:00
|
|
|
models = models
|
|
|
|
|
2023-04-09 21:41:10 +00:00
|
|
|
# def __init__(self, cfg):
|
|
|
|
# super(EventPlugin, self).__init__(cfg)
|
|
|
|
# from . import routes
|
|
|
|
# from .event_controller import clear_services
|
|
|
|
|
2023-04-10 12:55:17 +00:00
|
|
|
def load(self):
|
|
|
|
from .routes import blueprint
|
2023-04-30 11:55:00 +00:00
|
|
|
|
2023-04-10 12:55:17 +00:00
|
|
|
self.blueprint = blueprint
|
|
|
|
|
2023-04-09 21:41:10 +00:00
|
|
|
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"])
|