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

Function get_dot_atom

Lib/email/_header_value_parser.py:1384–1407  ·  view source on GitHub ↗

dot-atom = [CFWS] dot-atom-text [CFWS] Any place we can have a dot atom, we could instead have an rfc2047 encoded word.

(value)

Source from the content-addressed store, hash-verified

1382 return dot_atom_text, value
1383
1384def get_dot_atom(value):
1385 """ dot-atom = [CFWS] dot-atom-text [CFWS]
1386
1387 Any place we can have a dot atom, we could instead have an rfc2047 encoded
1388 word.
1389 """
1390 dot_atom = DotAtom()
1391 if value[0] in CFWS_LEADER:
1392 token, value = get_cfws(value)
1393 dot_atom.append(token)
1394 if value.startswith('=?'):
1395 try:
1396 token, value = get_encoded_word(value)
1397 except errors.HeaderParseError:
1398 # XXX: need to figure out how to register defects when
1399 # appropriate here.
1400 token, value = get_dot_atom_text(value)
1401 else:
1402 token, value = get_dot_atom_text(value)
1403 dot_atom.append(token)
1404 if value and value[0] in CFWS_LEADER:
1405 token, value = get_cfws(value)
1406 dot_atom.append(token)
1407 return dot_atom, value
1408
1409def get_word(value):
1410 """word = atom / quoted-string

Callers 2

get_local_partFunction · 0.85
get_domainFunction · 0.85

Calls 6

DotAtomClass · 0.85
get_cfwsFunction · 0.85
get_encoded_wordFunction · 0.85
get_dot_atom_textFunction · 0.85
appendMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…