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
f776e692
Commit
f776e692
authored
Sep 28, 2002
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup and add docstrings.
parent
5bdb2bee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
Lib/email/__init__.py
Lib/email/__init__.py
+17
-2
No files found.
Lib/email/__init__.py
View file @
f776e692
...
...
@@ -27,18 +27,33 @@ __all__ = ['Charset',
]
try
:
True
,
False
except
NameError
:
True
=
1
False
=
0
# Some convenience routines. Don't import Parser and Message as side-effects
# of importing email since those cascadingly import most of the rest of the
# email package.
def
message_from_string
(
s
,
_class
=
None
,
strict
=
0
):
def
message_from_string
(
s
,
_class
=
None
,
strict
=
False
):
"""Parse a string into a Message object model.
Optional _class and strict are passed to the Parser constructor.
"""
from
email.Parser
import
Parser
if
_class
is
None
:
from
email.Message
import
Message
_class
=
Message
return
Parser
(
_class
,
strict
=
strict
).
parsestr
(
s
)
def
message_from_file
(
fp
,
_class
=
None
,
strict
=
0
):
def
message_from_file
(
fp
,
_class
=
None
,
strict
=
False
):
"""Read a file and parse its contents into a Message object model.
Optional _class and strict are passed to the Parser constructor.
"""
from
email.Parser
import
Parser
if
_class
is
None
:
from
email.Message
import
Message
...
...
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