atom = [CFWS] 1*atext [CFWS] An atom could be an rfc2047 encoded word.
(value)
| 1336 | return quoted_string, value |
| 1337 | |
| 1338 | def get_atom(value): |
| 1339 | """atom = [CFWS] 1*atext [CFWS] |
| 1340 | |
| 1341 | An atom could be an rfc2047 encoded word. |
| 1342 | """ |
| 1343 | atom = Atom() |
| 1344 | if value and value[0] in CFWS_LEADER: |
| 1345 | token, value = get_cfws(value) |
| 1346 | atom.append(token) |
| 1347 | if value and value[0] in ATOM_ENDS: |
| 1348 | raise errors.HeaderParseError( |
| 1349 | "expected atom but found '{}'".format(value)) |
| 1350 | if value.startswith('=?'): |
| 1351 | try: |
| 1352 | token, value = get_encoded_word(value) |
| 1353 | except errors.HeaderParseError: |
| 1354 | # XXX: need to figure out how to register defects when |
| 1355 | # appropriate here. |
| 1356 | token, value = get_atext(value) |
| 1357 | else: |
| 1358 | token, value = get_atext(value) |
| 1359 | atom.append(token) |
| 1360 | if value and value[0] in CFWS_LEADER: |
| 1361 | token, value = get_cfws(value) |
| 1362 | atom.append(token) |
| 1363 | return atom, value |
| 1364 | |
| 1365 | def get_dot_atom_text(value): |
| 1366 | """ dot-text = 1*atext *("." 1*atext) |
no test coverage detected
searching dependent graphs…