flaschengeist/geruecht/controller/__init__.py

30 lines
898 B
Python

from geruecht.logger import getLogger
LOGGER = getLogger(__name__)
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]
from .databaseController import DatabaseController
def getDatabesController():
if db is not None:
return db
else:
return DatabaseController()
from .ldapController import LDAPController
def getLDAPController():
if ldapController is not None:
return ldapController
else:
return LDAPController()
from .accesTokenController import AccesTokenController
db = DatabaseController()
ldapController = LDAPController()
accesTokenController = AccesTokenController("GERUECHT")
from . userController import UserController
userController = UserController()