MCPcopy Index your code
hub / github.com/python/cpython / parsestr

Method parsestr

Lib/email/parser.py:56–64  ·  view source on GitHub ↗

Create a message structure from a string. Returns the root of the message structure. Optional headersonly is a flag specifying whether to stop parsing after reading the headers or not. The default is False, meaning it parses the entire contents of the file.

(self, text, headersonly=False)

Source from the content-addressed store, hash-verified

54 return feedparser.close()
55
56 def parsestr(self, text, headersonly=False):
57 """Create a message structure from a string.
58
59 Returns the root of the message structure. Optional headersonly is a
60 flag specifying whether to stop parsing after reading the headers or
61 not. The default is False, meaning it parses the entire contents of
62 the file.
63 """
64 return self.parse(StringIO(text), headersonly=headersonly)
65
66
67class HeaderParser(Parser):

Callers 9

test_parserMethod · 0.95
email-headers.pyFile · 0.45
message_from_stringFunction · 0.45
parsestrMethod · 0.45
parsebytesMethod · 0.45
_parse_header_linesFunction · 0.45

Calls 2

parseMethod · 0.95
StringIOClass · 0.90