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

Function get_dot_atom

Lib/email/_header_value_parser.py:1367–1390  ·  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

1365 return dot_atom_text, value
1366
1367def get_dot_atom(value):
1368 """ dot-atom = [CFWS] dot-atom-text [CFWS]
1369
1370 Any place we can have a dot atom, we could instead have an rfc2047 encoded
1371 word.
1372 """
1373 dot_atom = DotAtom()
1374 if value[0] in CFWS_LEADER:
1375 token, value = get_cfws(value)
1376 dot_atom.append(token)
1377 if value.startswith('=?'):
1378 try:
1379 token, value = get_encoded_word(value)
1380 except errors.HeaderParseError:
1381 # XXX: need to figure out how to register defects when
1382 # appropriate here.
1383 token, value = get_dot_atom_text(value)
1384 else:
1385 token, value = get_dot_atom_text(value)
1386 dot_atom.append(token)
1387 if value and value[0] in CFWS_LEADER:
1388 token, value = get_cfws(value)
1389 dot_atom.append(token)
1390 return dot_atom, value
1391
1392def get_word(value):
1393 """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