Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(9)  |  Derive(0)  |  Import(0)
This function converts the given header field name from short
notation into full name, removes the - character and capitalizes
the name.

        def getMappedHFH(hfh):
	"""This function converts the given header field name from short
	notation into full name, removes the - character and capitalizes
	the name.
	"""
	hfh_dict = {'I': 'Callid', \
				'M': 'Contact', \
				'E': 'Contentencoding', \
				'L': 'Contentlength', \
				'C': 'Contenttype', \
				'F': 'From', \
				'R': 'Referto', \
				'S': 'Subject', \
				'K': 'Supported', \
				'T': 'To', \
				'V': 'Via'}
	hfhl = hfh.replace("-", "").capitalize()
	if hfh_dict.has_key(hfhl):
		return hfh_dict[hfh.replace("-", "").capitalize()]
	else:
		return hfhl
        


src/s/f/sftf-HEAD/SipMessage.py   sftf(Download)
		name is not know also the raw name will be used.
		"""
		if Helper.getRevMappedHFH(Helper.getMappedHFH(hfName)):
			self.headerFields[Helper.getMappedHFH(hfName)] = hfValue
		else:
			else:
				Log.logDebug("SipMessage.parseHeaderFiled(): header field name '" + str(hfn_raw) + "' is not in RFC3261", 2)
		hfn = Helper.getMappedHFH(headerStr[0:index].rstrip())
		if (self.headerFields.has_key(hfn) and (hfn in Helper.multiple_headers)):
			self.setHeaderValue(hfn, self.getHeaderValue(hfn).rstrip() + \
	def hasParsedHeaderField(self, hfName):
		"""Returns boolean if the message has a parsed header field with
		the given name.
		"""
		hfn_m = Helper.getMappedHFH(hfName)
	def getParsedHeaderValue(self, hfName):
		"""Returns the object of the parsed header field if present. If the
		header is not present None will be returned.
		"""
		hfn_m = Helper.getMappedHFH(hfName)

src/s/f/sftf-HEAD/Transaction.py   sftf(Download)
				else:
					Log.logDebug("Transaction.createReply(): request missing mandatory HFH: " + str(i), 2)
				i_m = Helper.getMappedHFH(i)
				if i_m is None:
					Log.logDebug("Transaction.createReply(): unable to match HFH: " + str(i), 3)

src/s/f/sftf-HEAD/TestCase.py   sftf(Download)
		# header field and call the parser of the class
		for i in _message.getHeaderFieldNames():
			i_mapped = Helper.getMappedHFH(i)
			Log.logDebug("TestCase.parseMessage(): HF: " + str(i) + ", mapped: " + str(i_mapped), 5)
			hf = Helper.createClassInstance(i_mapped)
		no parser is present for the given 'name' None will be returned.
		"""
		return Helper.createClassInstance(Helper.getMappedHFH(name))
 
	def reTry(self, message):