Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
057b8428
Commit
057b8428
authored
Sep 30, 2002
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docstring consistency with the updated .tex files.
parent
67911370
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
Lib/email/Parser.py
Lib/email/Parser.py
+14
-0
No files found.
Lib/email/Parser.py
View file @
057b8428
...
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment