TrixterFilm/trackteroid

defer session initialization

rkoschmitzky opened this issue · 0 comments

Goal

Initialize a session when actually needed and not on module import.

Motivation

Currently, the SESSION singleton will be created when importing trackteroid which is not ideal as it results in an ImportError if a connection can not be established. Instead, the connection attempt should be made when actually needed.

Considerations

As our Session class already acts as a delegate for the Ftrack Python API Session we might be able to track and establish a connection on any self._session attribute access.