MCPcopy Index your code
hub / github.com/RustPython/RustPython / local_part

Method local_part

Lib/email/_header_value_parser.py:627–647  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

625
626 @property
627 def local_part(self):
628 # Strip whitespace from front, back, and around dots.
629 res = [DOT]
630 last = DOT
631 last_is_tl = False
632 for tok in self[0] + [DOT]:
633 if tok.token_type == 'cfws':
634 continue
635 if (last_is_tl and tok.token_type == 'dot' and
636 last[-1].token_type == 'cfws'):
637 res[-1] = TokenList(last[:-1])
638 is_tl = isinstance(tok, TokenList)
639 if (is_tl and last.token_type == 'dot' and
640 tok[0].token_type == 'cfws'):
641 res.append(TokenList(tok[1:]))
642 else:
643 res.append(tok)
644 last = res[-1]
645 last_is_tl = is_tl
646 res = TokenList(res[1:-1])
647 return res.value
648
649
650class DomainLiteral(TokenList):

Callers

nothing calls this directly

Calls 3

TokenListClass · 0.85
isinstanceFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected