# 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

	def __init__(self, value=None):
		HeaderFieldHandler.__init__(self)
		self.type = None
		self.params = []
		if value is not None:
			self.parse(value)

	def __str__(self):
		return '[type:\'' + str(self.type) + '\', ' \
				+ 'params:\'' + str(self.params) + '\']'

	def parse(self, value):
		v = value.replace("\r", "").replace("\t", "").strip()
		sep = v.find(";")
		if (sep != -1):
			self.type = v[:sep].strip()
			pm = v[sep+1:]
			self.params = pm.split(";")
		else:
			self.type = v

	def create(self):
		ret = ''
		if self.type is not None:
			ret = str(self.type)
		for i in self.params:
			ret = ret + ';' + i
		return ret + '\r\n'


# 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/Contentdisposition.py
from HeaderFieldHandler import HeaderFieldHandler
from SCException import SCNotImplemented, HFHException


	def __init__(self, value=None):
		HeaderFieldHandler.__init__(self)
		self.type = None
		self.params = []
		if value is not None:
			self.parse(value)

	def __str__(self):
		return '[type:\'' + str(self.type) + '\', ' \
				+ 'params:\'' + str(self.params) + '\']'

	def parse(self, value):
		v = value.replace("\r", "").replace("\t", "").strip()
		sep = v.find(";")
		if (sep != -1):
			self.type = v[:sep].strip()
			pm = v[sep+1:]
			self.params = pm.split(";")
		else:
			self.type = v

	def create(self):
		ret = ''
		if self.type is not None:
			ret = str(self.type)
		for i in self.params:
			ret = ret + ';' + i
		return ret + '\r\n'


	def verify(self):