def __init__(self, username, password, authoritative_source, auth_backend, auth_options={}): """ Constructor. Note that the instance variables not are set by the constructor but by the :func:`authenticate` method. Therefore, run the :func:`authenticate`-method before trying to access those variables! * `username` [string] Username to authenticate as. * `password` [string] Password to authenticate with. * `authoritative_source` [string] Authoritative source of the query. * `auth_backend` [string] Name of authentication backend. * `auth_options` [dict] A dict which, if authenticated as a trusted user, can override `username` and `authoritative_source`. """ self._logger = logging.getLogger(self.__class__.__name__) self._cfg = NipapConfig() self.username = username self.password = password self.auth_backend = auth_backend self.authoritative_source = authoritative_source self._auth_options = auth_options
def __init__(self): """ Constructor. """ # Initialize stuff. self._config = NipapConfig() self._logger = logging.getLogger(self.__class__.__name__) self._init_backends()