+ self.login_data = {}
+ self.token = ''
+ try: self._setlogin(username, password)
+ except requests.exceptions.MissingSchema:
+ self.pod = '{0}://{1}'.format(schema, self.pod)
+ warnings.warn('schema was missing')
+ finally: pass
+ try: self._setlogin(username, password)
+ except Exception as e: raise LoginError('cannot create login data (caused by: {0})'.format(e))
+
+ def __repr__(self):
+ """Returns token string.
+ It will be easier to change backend if programs will just use:
+ repr(connection)
+ instead of calling a specified method.
+ """
+ return self.get_token()