/home/lnzliplg/public_html/mime.tar
multipart.py 0000644 00000003045 15173343564 0007154 0 ustar 00 # Copyright (C) 2002-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Base class for MIME multipart/* type messages."""
__all__ = ['MIMEMultipart']
from email.mime.base import MIMEBase
class MIMEMultipart(MIMEBase):
"""Base class for MIME multipart/* type messages."""
def __init__(self, _subtype='mixed', boundary=None, _subparts=None,
**_params):
"""Creates a multipart/* type message.
By default, creates a multipart/mixed message, with proper
Content-Type and MIME-Version headers.
_subtype is the subtype of the multipart content type, defaulting to
`mixed'.
boundary is the multipart boundary string. By default it is
calculated as needed.
_subparts is a sequence of initial subparts for the payload. It
must be an iterable object, such as a list. You can always
attach new subparts to the message by using the attach() method.
Additional parameters for the Content-Type header are taken from the
keyword arguments (or passed into the _params argument).
"""
MIMEBase.__init__(self, 'multipart', _subtype, **_params)
# Initialise _payload to an empty list as the Message superclass's
# implementation of is_multipart assumes that _payload is a list for
# multipart messages.
self._payload = []
if _subparts:
for p in _subparts:
self.attach(p)
if boundary:
self.set_boundary(boundary)
audio.pyc 0000644 00000005535 15173343564 0006405 0 ustar 00 �
{fc @ s� d Z d g Z d d l Z d d l m Z d d l m Z d d l m Z i d d 6d d
6d d 6d d
6Z d � Z
d e f d � � YZ d S( s/ Class representing audio/* type MIME documents.t MIMEAudioi����N( t StringIO( t encoders( t MIMENonMultipartt basict aus x-wavt wavs x-aifft aifft aifcc C sZ | d } t | � } x= t j D]2 } | | | � } | d k r t j | d � Sq Wd S( s Try to identify a sound file type.
sndhdr.what() has a pretty cruddy interface, unfortunately. This is why
we re-do it here. It would be easier to reverse engineer the Unix 'file'
command and use the standard 'magic' file, as shipped with a modern Unix.
i i N( R t sndhdrt testst Nonet _sndhdr_MIMEmapt get( t datat hdrt fakefilet testfnt res( ( s( /usr/lib64/python2.7/email/mime/audio.pyt _whatsnd s
c B s e Z d Z d e j d � Z RS( s, Class for generating audio/* MIME documents.c K sg | d k r t | � } n | d k r6 t d � � n t j | d | | � | j | � | | � d S( s Create an audio/* type MIME document.
_audiodata is a string containing the raw audio data. If this data
can be decoded by the standard Python `sndhdr' module, then the
subtype will be automatically included in the Content-Type header.
Otherwise, you can specify the specific audio subtype via the
_subtype parameter. If _subtype is not given, and no subtype can be
guessed, a TypeError is raised.
_encoder is a function which will perform the actual encoding for
transport of the image data. It takes one argument, which is this
Image instance. It should use get_payload() and set_payload() to
change the payload to the encoded form. It should also add any
Content-Transfer-Encoding or other headers to the message as
necessary. The default encoding is Base64.
Any additional keyword arguments are passed to the base class
constructor, which turns them into parameters on the Content-Type
header.
s! Could not find audio MIME subtypet audioN( R R t TypeErrorR t __init__t set_payload( t selft
_audiodatat _subtypet _encodert _params( ( s( /usr/lib64/python2.7/email/mime/audio.pyR - s
N( t __name__t
__module__t __doc__R R t
encode_base64R ( ( ( s( /usr/lib64/python2.7/email/mime/audio.pyR * s ( R t __all__R t cStringIOR t emailR t email.mime.nonmultipartR R R R ( ( ( s( /usr/lib64/python2.7/email/mime/audio.pyt <module> s
nonmultipart.pyo 0000644 00000001570 15173343564 0010047 0 ustar 00 �
{fc @ sI d Z d g Z d d l m Z d d l m Z d e f d � � YZ d S( s9 Base class for MIME type messages that are not multipart.t MIMENonMultiparti����( t errors( t MIMEBasec B s e Z d Z d � Z RS( s0 Base class for MIME non-multipart type messages.c C s t j d � � d S( Ns4 Cannot attach additional subparts to non-multipart/*( R t MultipartConversionError( t selft payload( ( s/ /usr/lib64/python2.7/email/mime/nonmultipart.pyt attach s ( t __name__t
__module__t __doc__R ( ( ( s/ /usr/lib64/python2.7/email/mime/nonmultipart.pyR s N( R t __all__t emailR t email.mime.baseR R ( ( ( s/ /usr/lib64/python2.7/email/mime/nonmultipart.pyt <module> s message.pyc 0000644 00000002650 15173343564 0006723 0 ustar 00 �
{fc @ sI d Z d g Z d d l m Z d d l m Z d e f d � � YZ d S( s, Class representing message/* MIME documents.t MIMEMessagei����( t message( t MIMENonMultipartc B s e Z d Z d d � Z RS( s, Class representing message/* MIME documents.t rfc822c C sX t j | d | � t | t j � s4 t d � � n t j j | | � | j d � d S( s� Create a message/* type MIME document.
_msg is a message object and must be an instance of Message, or a
derived class of Message, otherwise a TypeError is raised.
Optional _subtype defines the subtype of the contained message. The
default is "rfc822" (this is defined by the MIME standard, even though
the term "rfc822" is technically outdated by RFC 2822).
R s&