Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: third_party/google-endpoints/future/backports/email/mime/message.py

Issue 2666783008: Add google-endpoints to third_party/. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright (C) 2001-2006 Python Software Foundation
2 # Author: Barry Warsaw
3 # Contact: email-sig@python.org
4
5 """Class representing message/* MIME documents."""
6 from __future__ import unicode_literals
7 from __future__ import division
8 from __future__ import absolute_import
9
10 __all__ = ['MIMEMessage']
11
12 from future.backports.email import message
13 from future.backports.email.mime.nonmultipart import MIMENonMultipart
14
15
16 class MIMEMessage(MIMENonMultipart):
17 """Class representing message/* MIME documents."""
18
19 def __init__(self, _msg, _subtype='rfc822'):
20 """Create a message/* type MIME document.
21
22 _msg is a message object and must be an instance of Message, or a
23 derived class of Message, otherwise a TypeError is raised.
24
25 Optional _subtype defines the subtype of the contained message. The
26 default is "rfc822" (this is defined by the MIME standard, even though
27 the term "rfc822" is technically outdated by RFC 2822).
28 """
29 MIMENonMultipart.__init__(self, 'message', _subtype)
30 if not isinstance(_msg, message.Message):
31 raise TypeError('Argument is not an instance of Message')
32 # It's convenient to use this base class method. We need to do it
33 # this way or we'll get an exception
34 message.Message.attach(self, _msg)
35 # And be sure our default type is set correctly
36 self.set_default_type('message/rfc822')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698