Пример #1
0
    def __init__(self):
        """
Constructor __init__(AbstractResponse)

:since: v0.2.00
        """

        SupportsMixin.__init__(self)

        self.log_handler = None
        """
The LogHandler is called whenever debug messages should be logged or errors
happened.
        """
        self.store = { }
        """
Response specific data store
        """

        AbstractResponse._local.weakref_instance = ref(self)

        self.store['dNG.data.Settings'] = StackedDict()
        self.store['dNG.data.Settings'].add_dict(Settings.get_dict())
Пример #2
0
    def __init__(self):
        """
Constructor __init__(Connection)

:since: v1.0.0
        """

        self.local = None
        """
Local data handle
        """
        self._log_handler = NamedLoader.get_singleton("dNG.data.logging.LogHandler", False)
        """
The LogHandler is called whenever debug messages should be logged or errors
happened.
        """

        if (Connection._sa_engine is None):
            with Connection._instance_lock:
                # Thread safety
                if (Connection._sa_engine is None):
                    Connection._sa_engine = engine_from_config(Settings.get_dict(),
                                                               prefix = "pas_database_sqlalchemy_"
                                                              )