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

Function get_qp_ctext

Lib/email/_header_value_parser.py:1174–1189  ·  view source on GitHub ↗

r"""ctext = This is not the RFC ctext, since we are handling nested comments in comment and unquoting quoted-pairs here. We allow anything except the '()' characters, but if we find any ASCII other than the RFC defined printable ASCII, a NonPrintableD

(value)

Source from the content-addressed store, hash-verified

1172 return unstructured
1173
1174def get_qp_ctext(value):
1175 r"""ctext = <printable ascii except \ ( )>
1176
1177 This is not the RFC ctext, since we are handling nested comments in comment
1178 and unquoting quoted-pairs here. We allow anything except the '()'
1179 characters, but if we find any ASCII other than the RFC defined printable
1180 ASCII, a NonPrintableDefect is added to the token&#x27;s defects list. Since
1181 quoted pairs are converted to their unquoted values, what is returned is
1182 a 'ptext' token. In this case it is a WhiteSpaceTerminal, so it&#x27;s value
1183 is ' '.
1184
1185 """
1186 ptext, value, _ = _get_ptext_to_endchars(value, '()')
1187 ptext = WhiteSpaceTerminal(ptext, 'ptext')
1188 _validate_xtext(ptext)
1189 return ptext, value
1190
1191def get_qcontent(value):
1192 """qcontent = qtext / quoted-pair

Callers 1

get_commentFunction · 0.85

Calls 3

_get_ptext_to_endcharsFunction · 0.85
WhiteSpaceTerminalClass · 0.85
_validate_xtextFunction · 0.85

Tested by

no test coverage detected