diff options
author | Barry Warsaw <barry@python.org> | 2002-09-30 20:07:22 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2002-09-30 20:07:22 (GMT) |
commit | 057b8428d02bd8179cab752cf23ebc11b934a1c4 (patch) | |
tree | ba0969fa7288b0555b9200317528246d83cd21f7 | |
parent | 679113702c54dd9fe5615e1b51af0b50416711b6 (diff) | |
download | cpython-057b8428d02bd8179cab752cf23ebc11b934a1c4.zip cpython-057b8428d02bd8179cab752cf23ebc11b934a1c4.tar.gz cpython-057b8428d02bd8179cab752cf23ebc11b934a1c4.tar.bz2 |
Docstring consistency with the updated .tex files.
-rw-r--r-- | Lib/email/Parser.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/email/Parser.py b/Lib/email/Parser.py index 98d20c3..119a90d 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): |