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

Function get_atom

Lib/email/_header_value_parser.py:1321–1346  ·  view source on GitHub ↗

atom = [CFWS] 1*atext [CFWS] An atom could be an rfc2047 encoded word.

(value)

Source from the content-addressed store, hash-verified

1319 return quoted_string, value
1320
1321def get_atom(value):
1322 """atom = [CFWS] 1*atext [CFWS]
1323
1324 An atom could be an rfc2047 encoded word.
1325 """
1326 atom = Atom()
1327 if value and value[0] in CFWS_LEADER:
1328 token, value = get_cfws(value)
1329 atom.append(token)
1330 if value and value[0] in ATOM_ENDS:
1331 raise errors.HeaderParseError(
1332 "expected atom but found '{}'".format(value))
1333 if value.startswith('=?'):
1334 try:
1335 token, value = get_encoded_word(value)
1336 except errors.HeaderParseError:
1337 # XXX: need to figure out how to register defects when
1338 # appropriate here.
1339 token, value = get_atext(value)
1340 else:
1341 token, value = get_atext(value)
1342 atom.append(token)
1343 if value and value[0] in CFWS_LEADER:
1344 token, value = get_cfws(value)
1345 atom.append(token)
1346 return atom, value
1347
1348def get_dot_atom_text(value):
1349 """ dot-text = 1*atext *("." 1*atext)

Callers 2

get_wordFunction · 0.85
get_domainFunction · 0.85

Calls 7

AtomClass · 0.85
get_cfwsFunction · 0.85
get_encoded_wordFunction · 0.85
get_atextFunction · 0.85
appendMethod · 0.45
formatMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected