home *** CD-ROM | disk | FTP | other *** search
- <TITLE>mimetools -- Python library reference</TITLE>
- Next: <A HREF="../b/binhex" TYPE="Next">binhex</A>
- Prev: <A HREF="../r/rfc822" TYPE="Prev">rfc822</A>
- Up: <A HREF="../i/internet_and_www" TYPE="Up">Internet and WWW</A>
- Top: <A HREF="../t/top" TYPE="Top">Top</A>
- <H1>10.12. Standard Module <CODE>mimetools</CODE></H1>
- This module defines a subclass of the class <CODE>rfc822.Message</CODE> and
- a number of utility functions that are useful for the manipulation for
- MIME style multipart or encoded message.
- <P>
- It defines the following items:
- <P>
- <DL><DT><B>Message</B> (<VAR>fp</VAR>) -- function of module mimetools<DD>
- Return a new instance of the <CODE>mimetools.Message</CODE> class. This is
- a subclass of the <CODE>rfc822.Message</CODE> class, with some additional
- methods (see below).
- </DL>
- <DL><DT><B>choose_boundary</B> () -- function of module mimetools<DD>
- Return a unique string that has a high likelihood of being usable as a
- part boundary. The string has the form
- <CODE>"<VAR>hostipaddr</VAR>.<VAR>uid</VAR>.<VAR>pid</VAR>.<VAR>timestamp</VAR>.<VAR>random</VAR>"</CODE>.
- </DL>
- <DL><DT><B>decode</B> (<VAR>input</VAR>, <VAR>output</VAR>, <VAR>encoding</VAR>) -- function of module mimetools<DD>
- Read data encoded using the allowed MIME <VAR>encoding</VAR> from open file
- object <VAR>input</VAR> and write the decoded data to open file object
- <VAR>output</VAR>. Valid values for <VAR>encoding</VAR> include
- <CODE>"base64"</CODE>, <CODE>"quoted-printable"</CODE> and <CODE>"uuencode"</CODE>.
- </DL>
- <DL><DT><B>encode</B> (<VAR>input</VAR>, <VAR>output</VAR>, <VAR>encoding</VAR>) -- function of module mimetools<DD>
- Read data from open file object <VAR>input</VAR> and write it encoded using
- the allowed MIME <VAR>encoding</VAR> to open file object <VAR>output</VAR>.
- Valid values for <VAR>encoding</VAR> are the same as for <CODE>decode()</CODE>.
- </DL>
- <DL><DT><B>copyliteral</B> (<VAR>input</VAR>, <VAR>output</VAR>) -- function of module mimetools<DD>
- Read lines until EOF from open file <VAR>input</VAR> and write them to open
- file <VAR>output</VAR>.
- </DL>
- <DL><DT><B>copybinary</B> (<VAR>input</VAR>, <VAR>output</VAR>) -- function of module mimetools<DD>
- Read blocks until EOF from open file <VAR>input</VAR> and write them to open
- file <VAR>output</VAR>. The block size is currently fixed at 8192.
- </DL>
- <H2>Menu</H2><DL COMPACT>
- <DT><A HREF="../m/mimetools_message_methods" TYPE=Menu>mimetools.Message Methods</A>
- <DD></DL>
-