From: Barry Warsaw Date: Mon, 30 Sep 2002 20:07:22 +0000 (+0000) Subject: Docstring consistency with the updated .tex files. X-Git-Tag: v2.3c1~3934 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=057b8428d02bd8179cab752cf23ebc11b934a1c4;p=python Docstring consistency with the updated .tex files. --- diff --git a/Lib/email/Parser.py b/Lib/email/Parser.py index 98d20c3bdc..119a90dbf4 100644 --- a/Lib/email/Parser.py +++ b/Lib/email/Parser.py @@ -49,6 +49,13 @@ class Parser: self._strict = strict def parse(self, fp, headersonly=False): + """Create a message structure from the data in a file. + + Reads all the data from the file and 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. + """ root = self._class() self._parseheaders(root, fp) if not headersonly: @@ -56,6 +63,13 @@ class Parser: return root def parsestr(self, text, headersonly=False): + """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. + """ return self.parse(StringIO(text), headersonly=headersonly) def _parseheaders(self, container, fp):