# Path: SCException.py
# class SCNotImplemented (SCException):
# 	"""See SCException. Called if implementation is missing."""
# 
# 	def __init__(self, cls, function, reason):
# 		SCException.__init__(self, cls, function, reason)
# 
# class HFHException(SCException):
# 	"""See SCException. Called for exceptions during parsing header fields."""
# 
# 	def __init__(self, cls, function, reason):
# 		SCException.__init__(self, cls, function, reason)


from HeaderFieldHandler import HeaderFieldHandler
from SCException import SCNotImplemented, HFHException
from random import Random
import Log, Config
				else:
					self.params.append(v)
					raise HFHException("WWWAuthenticate", "parse", "quotation not closed")
			elif (eq != -1 and eq < cm):
				nameval = v[eq+1:cm]
				oldv = v[:cm]
				v = v[cm+1:].lstrip()
			elif (eq != -1 and cm == -1):
				nameval = v[eq+1:]
				v = ''
			else:
				self.params.append(v)
				raise HFHException("WWWAuthenticate", "parse", "failed to parse auth token")
			# assign the value
			if (name == "realm"):
				self.realm = nameval
			elif (name == "nonce"):
				self.nonce = nameval
			elif (name == "domain"):
				self.domain = nameval
			elif (name == "algorithm"):
				self.algorithm = nameval
			elif (name == "opaque"):
				self.opaque = nameval
			elif (name == "qop"):
				self.qop = nameval
			elif (name == "stale"):
				self.stale = nameval
			else:
				self.params.append(oldv)

# Path: SCException.py
# class SCNotImplemented (SCException):
# 	"""See SCException. Called if implementation is missing."""
# 
# 	def __init__(self, cls, function, reason):
# 		SCException.__init__(self, cls, function, reason)
# 
# class HFHException(SCException):
# 	"""See SCException. Called for exceptions during parsing header fields."""
# 
# 	def __init__(self, cls, function, reason):
# 		SCException.__init__(self, cls, function, reason)


# Path: HFH/Wwwauthenticate.py
from HeaderFieldHandler import HeaderFieldHandler
from SCException import SCNotImplemented, HFHException
from random import Random
import Log, Config

				else:
					self.params.append(v)
					raise HFHException("WWWAuthenticate", "parse", "quotation not closed")
			elif (eq != -1 and eq < cm):
				nameval = v[eq+1:cm]
				oldv = v[:cm]
				v = v[cm+1:].lstrip()
			elif (eq != -1 and cm == -1):
				nameval = v[eq+1:]
				v = ''
			else:
				self.params.append(v)
				raise HFHException("WWWAuthenticate", "parse", "failed to parse auth token")
			# assign the value
			if (name == "realm"):
				self.realm = nameval
			elif (name == "nonce"):
				self.nonce = nameval
			elif (name == "domain"):
				self.domain = nameval
			elif (name == "algorithm"):
				self.algorithm = nameval
			elif (name == "opaque"):
				self.opaque = nameval
			elif (name == "qop"):
				self.qop = nameval
			elif (name == "stale"):
				self.stale = nameval
			else:
				self.params.append(oldv)

				raise HFHException("WWWAuthenticate", "parse", "unsupported param")