def __str__(self): if self.isEmpty(): return 'None' try: login = str_(self.login) except UnicodeEncodeError: login = str_(self.login.encode(ENCODING)) resolver_config_id = str_(self.resolver_config_identifier or '') realm = str_(self.realm) return '<%s.%s@%s>' % (login, resolver_config_id, realm)