MCPcopy Index your code
hub / github.com/python/cpython / getrouteaddr

Method getrouteaddr

Lib/email/_parseaddr.py:333–363  ·  view source on GitHub ↗

Parse a route address (Return-path value). This method just skips all the route stuff and returns the addrspec.

(self)

Source from the content-addressed store, hash-verified

331 return returnlist
332
333 def getrouteaddr(self):
334 """Parse a route address (Return-path value).
335
336 This method just skips all the route stuff and returns the addrspec.
337 """
338 if self.field[self.pos] != '<':
339 return
340
341 expectroute = False
342 self.pos += 1
343 self.gotonext()
344 adlist = ''
345 while self.pos < len(self.field):
346 if expectroute:
347 self.getdomain()
348 expectroute = False
349 elif self.field[self.pos] == '>':
350 self.pos += 1
351 break
352 elif self.field[self.pos] == '@':
353 self.pos += 1
354 expectroute = True
355 elif self.field[self.pos] == ':':
356 self.pos += 1
357 else:
358 adlist = self.getaddrspec()
359 self.pos += 1
360 break
361 self.gotonext()
362
363 return adlist
364
365 def getaddrspec(self):
366 """Parse an RFC 2822 addr-spec."""

Callers 1

getaddressMethod · 0.95

Calls 3

gotonextMethod · 0.95
getdomainMethod · 0.95
getaddrspecMethod · 0.95

Tested by

no test coverage detected