0001 # Copyright (C) 2001-2004 Python Software Foundation 0002 # Author: Barry Warsaw 0003 # Contact: email-sig@python.org 0004 0005 """Class representing text/* type MIME documents.""" 0006 0007 from email.MIMENonMultipart import MIMENonMultipart 0008 from email.Encoders import encode_7or8bit 0009 0010 0011 0012 class MIMEText(MIMENonMultipart): 0013 """Class for generating text/* type MIME documents.""" 0014 0015 def __init__(self, _text, _subtype='plain', _charset='us-ascii'): 0016 """Create a text/* type MIME document. 0017 0018 _text is the string for this message object. 0019 0020 _subtype is the MIME sub content type, defaulting to "plain". 0021 0022 _charset is the character set parameter added to the Content-Type 0023 header. This defaults to "us-ascii". Note that as a side-effect, the 0024 Content-Transfer-Encoding header will also be set. 0025 """ 0026 MIMENonMultipart.__init__(self, 'text', _subtype, 0027 **{'charset': _charset}) 0028 self.set_payload(_text, _charset) 0029
Generated by PyXR 0.9.4