summaryrefslogtreecommitdiffstats
path: root/Lib/email
Commit message (Collapse)AuthorAgeFilesLines
* _parsebody(): Fix for the new message/rfc822 tree structure (theBarry Warsaw2002-06-021-4/+3
| | | | parent is now a multipart with one element, the sub-message object).
* header_encode(), encode(): Use _floordiv() from the appropriateBarry Warsaw2002-06-021-2/+9
| | | | compatibility module.
* Use absolute import paths for intrapackage imports.Barry Warsaw2002-06-021-2/+2
|
* Use absolute import paths for intrapackage imports.Barry Warsaw2002-06-021-5/+5
| | | | as_string(): Use Generator.flatten() for better performance.
* Use absolute import paths for intrapackage imports.Barry Warsaw2002-06-025-22/+23
| | | | | Use MIMENonMultipart as the base class so that you can't attach() to these non-multipart message types.
* flatten(): Renamed from __call__() which is (silently) deprecated.Barry Warsaw2002-06-021-7/+11
| | | | | | | | | __call__() can be 2-3x slower than the equivalent normal method. _handle_message(): The structure of message/rfc822 message has changed. Now parent's payload is a list of length 1, and the zeroth element is the Message sub-object. Adjust the printing of such message trees to reflect this change.
* _intdiv2() -> _floordiv(), merge of uncommitted changes.Barry Warsaw2002-06-022-8/+8
|
* Get email test to pass. Barry, hope this is what you had in mindNeal Norwitz2002-06-022-6/+6
|
* Bump to version 2.0.5, and also use absolute import paths.Barry Warsaw2002-06-011-3/+3
|
* These two classes provide bases for more specific content typeBarry Warsaw2002-06-012-0/+54
| | | | | | | | | | | | | subclasses. MIMENonMultipart: Base class for non-multipart/* content type subclass specializations, e.g. image/gif. This class overrides attach() which raises an exception, since it makes no sense to attach a subpart to e.g. an image/gif message. MIMEMultipart: Base class for multipart/* content type subclass specializations, e.g. multipart/mixed. Does little more than provide a useful constructor.
* The _compat modules now export _floordiv() instead of _intdiv2() forBarry Warsaw2002-06-011-5/+4
| | | | | | better code reuse. _split() Use _floordiv().
* Slightly better docstringBarry Warsaw2002-06-011-1/+1
|
* _is_unicode(): Use UnicodeType instead of the unicode builtin forBarry Warsaw2002-06-011-1/+3
| | | | Python 2.1 compatibility.
* Use floor division where appropriate.Guido van Rossum2002-05-291-2/+2
|
* Importing Charset should not fail when Unicode is disabled. (XXXGuido van Rossum2002-05-281-3/+11
| | | | | Using Unicode-aware methods may still die with a NameError on unicode. Maybe there's a more elegant solution but I doubt anybody cares.)
* Whitespace normalization.Tim Peters2002-05-236-27/+27
|
* Bump to version 2.0.4Barry Warsaw2002-05-221-1/+1
|
* getaddresses(): Like the change in rfc822.py, this one needs to accessBarry Warsaw2002-05-221-1/+1
| | | | | | the AddressList.addresslist attribute directly. Also, add a test case for the email.Utils.getaddresses() interface.
* I've thought about it some more, and I believe it is proper for theBarry Warsaw2002-05-191-10/+20
| | | | | | | | | | | | email package's Parser to handle the three common line endings. Certain protocols such as IMAP define CRLF line endings and it doesn't make sense for the client app to have to normalize the line endings before handing it message off to the Parser. _parsebody(): Be more flexible in the matching of line endings for finding the MIME separators. Accept any of \r, \n and \r\n. Note that we do /not/ change the line endings in the payloads, we just accept any of those three around MIME boundaries.
* Fixed a bug in the splitting of lines, and improved the splitting forBarry Warsaw2002-05-191-11/+29
| | | | | | | | | | | | | | | | | single byte character sets. Also fixed a semantic problem with the constructor's default arguments. Specifically, __init__(): Change the maxlinelen argument default to None instead of MAXLINELEN. The semantics should have been (and now are) that if maxlinelen is given it is always honored. If it isn't given, but header_name is given, then the maximum line length is calculated. If neither are given then the default 76 characters is used. _split(): If the character set is a single byte character set then we can split the line at the maxlinelen because we know that encoding the header won't increase its length. If the charset isn't a single byte charset then we use the quicker divide-and-conquer line splitting algorithm as before.
* Complete a merge of the mimelib project and the Python cvs codebasesBarry Warsaw2002-05-197-45/+168
| | | | | | | | | | | | | for the email package. The former is now just a shell project that has some extra files for packaging for independent use (e.g. setup.py and README). Added a compatibility layer so that the same API can be used in Python 2.1 and 2.2/2.3 with the major differences shuffled off into helper modules (_compat21.py and _compat22.py). Also bumped the package version number to 2.0.3 for some fixes to be checked in momentarily.
* parseaddr(): Don't use rfc822.parseaddr() because this now implies aBarry Warsaw2002-04-151-4/+3
| | | | | | | | double call to AddressList.getaddrlist(), and /that/ always returns an empty list for the second and subsequent calls. Instead, instantiate an AddressList directly, and get the parsed addresses out of the addresslist attribute.
* AddrlistClass -> AddressListBarry Warsaw2002-04-121-2/+2
|
* Sync'ing with standalone email package 2.0.1. This adds support forBarry Warsaw2002-04-1016-96/+1438
| | | | | | | | | non-us-ascii character sets in headers and bodies. Some API changes (with DeprecationWarnings for the old APIs). Better RFC-compliant implementations of base64 and quoted-printable. Updated test cases. Documentation updates to follow (after I finish writing them ;).
* Removed two unused imports. Closes patch #525225.Barry Warsaw2002-03-031-4/+0
| | | | 2.2.1 candidate (but not terribly important).
* _parsebody(): When adding subparts to a multipart container, make sureBarry Warsaw2002-01-271-2/+7
| | | | | | that the first subpart added makes the payload a list object. Otherwise, a multipart/* with only one subpart will not have the proper structure.
* decode(), encode(): Accepting the minor optimizations from SF patchBarry Warsaw2001-12-031-6/+7
| | | | | #486375, but not the rest of it, since that changes the documented semantics of encode().
* More typo fixes.Barry Warsaw2001-11-241-2/+2
|
* Docstring typo fix.Greg Ward2001-11-242-2/+2
|
* formatdate(): Jason Mastaler correctly points out that divmod with aBarry Warsaw2001-11-191-2/+8
| | | | | | negative modulus won't return the right values. So always do positive modulus on an absolute value and twiddle the sign as appropriate after the fact.
* formatdate(): The calculation of the minutes part of the zone wasBarry Warsaw2001-11-191-1/+2
| | | | | | | | incorrect for "uneven" timezones. This algorithm should work for even timezones (e.g. America/New_York) and uneven timezones (e.g. Australia/Adelaide and America/St_Johns). Closes SF bug #483231.
* Forgot to import time.Barry Warsaw2001-11-091-0/+1
|
* formatdate(): A better docstring.Barry Warsaw2001-11-091-4/+7
|
* formatdate(): An implementation to replace the one borrowed fromBarry Warsaw2001-11-091-1/+37
| | | | | | | | | | rfc822.py. The old rfc822.formatdate() produced date strings using obsolete syntax. The new version produces the preferred RFC 2822 dates. Also, an optional argument `localtime' is added, which if true, produces a date relative to the local timezone, with daylight savings time properly taken into account.
* walk(): Fix docstring; traversal is depth-first. Closes mimelib bugBarry Warsaw2001-11-051-1/+1
| | | | #477864.
* A fix for SF bug #472560, extra newlines returned by get_param() whenBarry Warsaw2001-10-251-1/+1
| | | | | | | | the separating semi-colon shows up on a continuation line (legal, but weird). Bug reported and fixed by Matthew Cowles. Test case and sample email included.
* Another merge from mimelib:Barry Warsaw2001-10-191-0/+2
| | | | | | _handle_multipart(): If there is an epilogue and the epilogue does not itself start with a newline, add a newline before writing the epilogue. Closes SF bug #472481.
* Two merges from the mimelib project:Barry Warsaw2001-10-171-4/+35
| | | | | | | | _split_header(): Split on folding whitespace if the attempt to split on semi-colons failed. _split_header(): Patch by Matthew Cowles for fixing SF bug # 471918, Generator splitting long headers.
* typed_subpart_iterator(): When getting the main type use 'text' as theBarry Warsaw2001-10-151-2/+2
| | | | | | failobj, and when getting the subtype use 'plain' as the failobj. text/plain is supposed to be the default if the message contains no Content-Type: header.
* HeaderParser: A new subclass of Parser which only parses the messageBarry Warsaw2001-10-111-0/+16
| | | | | | headers. It does not parse the body of the message, instead simply assigning it as a string to the container's payload. This can be much faster when you're only interested in a message's header.
* An audio/* class, like MIMEImage, contributed by Anthony Baxter.Barry Warsaw2001-10-091-0/+71
| | | | | Rewritten for style and the email package naming conventions by Barry.
* Fix __all__ to the current list of exported modules (must pass theBarry Warsaw2001-10-091-3/+4
| | | | tests in test_email.py).
* get_all(): We never returned failobj if we found no matching headers.Barry Warsaw2001-10-091-0/+4
| | | | Fix that, and also make the docstring describe failobj.
* Give me back my page breaks.Barry Warsaw2001-10-0412-22/+22
|
* Whitespace normalization.Tim Peters2001-10-0412-23/+23
|
* _parsebody(): Use get_boundary() and get_type().Barry Warsaw2001-09-261-10/+16
| | | | | | | Also, add a clause to the big-if to handle message/delivery-status content types. These create a message with subparts that are Message instances, which best represent the header blocks of this content type.
* has_key(): Implement in terms of get().Barry Warsaw2001-09-261-33/+58
| | | | | | | | | | | | | | | get_type(): Use a compiled regular expression, which can be shared. _get_params_preserve(): A helper method which extracts the header's parameter list preserving value quoting. I'm not sure that this needs to be a public method. It's necessary because we want get_param() and friends to return the unquoted parameter value, however we want the quote-preserved form for set_boundary(). get_params(), get_param(), set_boundary(): Implement in terms of _get_params_preserve(). walk(): Yield ourself first, then recurse over our subparts (if any).
* __init__(): Arguments major renamed to maintype and minor renamed toBarry Warsaw2001-09-261-3/+3
| | | | subtype for consistency with the rest of the package.
* Updated docstrings. Also,Barry Warsaw2001-09-261-7/+7
| | | | | | typed_subpart_iterator(): Arguments major renamed to maintype and minor renamed to subtype for consistency with the rest of the package.
* Image.py and class Image => MIMEImage.py and MIMEImageBarry Warsaw2001-09-264-36/+40
| | | | | | | | | Text.py and class Text => MIMEText.py and MIMEText MessageRFC822.py and class MessageRFC822 => MIMEMessage.py and MIMEMessage These are renamed so as to be more consistent; these are MIME specific derived classes for when creating the object model out of whole cloth.