How to use the sasl.error function in sasl

To help you get started, we’ve selected a few sasl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dwd / Suelta / sasl.py View on Github external
mech[name] = impl
		mechmap[name] = basescore + n

class error:
	def __init__( self, sasl, txt, mech=None ):
		self.sasl = sasl
		self.txt = txt
		self.mech = mech

	def __str__( self ):
		if self.mech is None:
			return "SASL Error for " + "something here" + ": " + self.txt
		else:
			return "SASL Error for " + "something here" + ", mechanism " + self.mech.mechname + ": " + self.txt

class cancelled(error):
	def __init__( self, sasl, mech=None ):
		error.__init__( self, sasl, "User cancelled", mech )

_answers = {}

class sasl:
	def __init__( self, host, service, mech=None, username=None, min=0, callback=None, secquery=None, tls_active=None, defrealm=None ):
		self.defrealm = defrealm or host
		self.service = service
		self.host = host
		self.stash_id = None
		self.testkey = None
		self.user = None
		self.mech = mech
		if username is not None:
			self.reset_stash_id( username )