예제 #1
0
 def parse(self, value):
     v = value.replace("\r", "").replace("\t", "").strip()
     if v == '*':
         self.star = True
     else:
         self.displayname, uristr, self.params, brackets = name_addr.parse(
             v)
         self.uri.parse(uristr)
         if (not brackets) and (len(self.uri.params) > 0) and (len(
                 self.uri.headers) == 0) and (len(self.params) == 0):
             self.params = self.uri.params
             self.uri.params = []
         prmlen = range(0, len(self.params))
         if len(self.params):
             prmlen.reverse()
             for i in prmlen:
                 if self.params[i].startswith(","):
                     self.next = Contact(self.params[i][1:])
                     self.params[i:i + 1] = []
                 elif self.params[i].lower().startswith("q="):
                     self.q = self.params[i][2:]
                     self.params[i:i + 1] = []
                 elif self.params[i].lower().startswith("expires="):
                     self.expires = self.params[i][8:]
                     self.params[i:i + 1] = []
예제 #2
0
	def sub_parse(self, sub_value):
		self.displayname, uristr, self.params, brackets = name_addr.parse(sub_value)
		self.uri.parse(uristr)
		if (not brackets) and (len(self.uri.params) > 0) and (len(self.uri.headers) == 0) and (len(self.params) == 0):
			self.params = self.uri.params
			self.uri.params = []
		for i in self.uri.params:
			if i in ('lr', 'LR', 'Lr', 'lR'):
				self.looseRouter = True
			elif i.lower().startswith('lr='):
				self.looseRouter = True
예제 #3
0
파일: To.py 프로젝트: VoIP-co-uk/sftf
	def parse(self, value):
		v = value.replace("\r", "").replace("\t", "").strip()
		self.displayname, uristr, self.params, brackets = name_addr.parse(v)
		self.uri.parse(uristr)
		if (not brackets) and (len(self.uri.params) > 0) and (len(self.uri.headers) == 0) and (len(self.params) == 0):
			self.params = self.uri.params
			self.uri.params = []
		paramslen = range(0, len(self.params))
		paramslen.reverse()
		for i in paramslen:
			if (self.params[i].lower().startswith("tag=")):
				self.tag = self.params[i][4:]
				self.params[i:i+1] = []
예제 #4
0
 def sub_parse(self, sub_value):
     self.displayname, uristr, self.params, brackets = name_addr.parse(
         sub_value)
     self.uri.parse(uristr)
     if (not brackets) and (len(self.uri.params) > 0) and (len(
             self.uri.headers) == 0) and (len(self.params) == 0):
         self.params = self.uri.params
         self.uri.params = []
     for i in self.uri.params:
         if i in ('lr', 'LR', 'Lr', 'lR'):
             self.looseRouter = True
         elif i.lower().startswith('lr='):
             self.looseRouter = True
예제 #5
0
	def parse(self, value):
		v = value.replace("\r", "").replace("\t", "").strip()
		self.displayname, uristr, self.params, brackets = name_addr.parse(v)
		self.uri.parse(uristr)
		if (not brackets) and (len(self.uri.params) > 0) and (len(self.uri.headers) == 0) and (len(self.params) == 0):
			self.params = self.uri.params
			self.uri.params = []
		prmlen = range(0, len(self.params))
		if len(self.params):
			prmlen.reverse()
			for i in prmlen:
				if self.params[i].startswith(","):
					self.next = Remotepartyid(self.params[i][1:])
					self.params[i:i+1] = []
예제 #6
0
파일: To.py 프로젝트: yulubupt/sftf
 def parse(self, value):
     v = value.replace("\r", "").replace("\t", "").strip()
     self.displayname, uristr, self.params, brackets = name_addr.parse(v)
     self.uri.parse(uristr)
     if (not brackets) and (len(self.uri.params) > 0) and (len(
             self.uri.headers) == 0) and (len(self.params) == 0):
         self.params = self.uri.params
         self.uri.params = []
     paramslen = range(0, len(self.params))
     paramslen.reverse()
     for i in paramslen:
         if (self.params[i].lower().startswith("tag=")):
             self.tag = self.params[i][4:]
             self.params[i:i + 1] = []
예제 #7
0
 def parse(self, value):
     v = value.replace("\r", "").replace("\t", "").strip()
     self.displayname, uristr, self.params, brackets = name_addr.parse(v)
     self.uri.parse(uristr)
     if (not brackets) and (len(self.uri.params) > 0) and (len(
             self.uri.headers) == 0) and (len(self.params) == 0):
         self.params = self.uri.params
         self.uri.params = []
     prmlen = range(0, len(self.params))
     if len(self.params):
         prmlen.reverse()
         for i in prmlen:
             if self.params[i].startswith(","):
                 self.next = Remotepartyid(self.params[i][1:])
                 self.params[i:i + 1] = []
예제 #8
0
파일: Contact.py 프로젝트: VoIP-co-uk/sftf
	def parse(self, value):
		v = value.replace("\r", "").replace("\t", "").strip()
		if v == '*':
			self.star = True
		else:
			self.displayname, uristr, self.params, brackets = name_addr.parse(v)
			self.uri.parse(uristr)
			if (not brackets) and (len(self.uri.params) > 0) and (len(self.uri.headers) == 0) and (len(self.params) == 0):
				self.params = self.uri.params
				self.uri.params = []
			prmlen = range(0, len(self.params))
			if len(self.params):
				prmlen.reverse()
				for i in prmlen:
					if self.params[i].startswith(","):
						self.next = Contact(self.params[i][1:])
						self.params[i:i+1] = []
					elif self.params[i].lower().startswith("q="):
						self.q = self.params[i][2:]
						self.params[i:i+1] = []
					elif self.params[i].lower().startswith("expires="):
						self.expires = self.params[i][8:]
						self.params[i:i+1] = []