dot-atom = [CFWS] dot-atom-text [CFWS] Any place we can have a dot atom, we could instead have an rfc2047 encoded word.
(value)
| 1365 | return dot_atom_text, value |
| 1366 | |
| 1367 | def 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 | |
| 1392 | def get_word(value): |
| 1393 | """word = atom / quoted-string |
no test coverage detected