summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-09-26 05:35:47 (GMT)
committerBarry Warsaw <barry@python.org>2001-09-26 05:35:47 (GMT)
commit57758e3a0223fd60b29eea828acf583703bd68fb (patch)
treee2b1e6857a829371211f7cf88425261e809fa25d /Lib/email
parent3dd978dfff316a521a899c9e17daa0795ec17edb (diff)
downloadcpython-57758e3a0223fd60b29eea828acf583703bd68fb.zip
cpython-57758e3a0223fd60b29eea828acf583703bd68fb.tar.gz
cpython-57758e3a0223fd60b29eea828acf583703bd68fb.tar.bz2
Updated docstrings. Also,
typed_subpart_iterator(): Arguments major renamed to maintype and minor renamed to subtype for consistency with the rest of the package.
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/Iterators.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/email/Iterators.py b/Lib/email/Iterators.py
index 998530f..d1ee53f 100644
--- a/Lib/email/Iterators.py
+++ b/Lib/email/Iterators.py
@@ -11,7 +11,7 @@ from types import StringType
def body_line_iterator(msg):
- """Iterator over the parts, returning the lines in a string payload."""
+ """Iterate over the parts, returning string payloads line-by-line."""
for subpart in msg.walk():
payload = subpart.get_payload()
if type(payload) is StringType:
@@ -20,14 +20,14 @@ def body_line_iterator(msg):
-def typed_subpart_iterator(msg, major='text', minor=None):
- """Iterator over the subparts with a given MIME type.
+def typed_subpart_iterator(msg, maintype='text', subtype=None):
+ """Iterate over the subparts with a given MIME type.
- Use `major' as the main MIME type to match against; this defaults to
- "text". Optional `minor' is the MIME subtype to match against; if
+ Use `maintype' as the main MIME type to match against; this defaults to
+ "text". Optional `subtype' is the MIME subtype to match against; if
omitted, only the main type is matched.
"""
for subpart in msg.walk():
- if subpart.get_main_type() == major:
- if minor is None or subpart.get_subtype() == minor:
+ if subpart.get_main_type() == maintype:
+ if subtype is None or subpart.get_subtype() == subtype:
yield subpart