mimetools
index
/usr/lib/python2.1/mimetools.py

Various tools used by MIME-reading or MIME-writing programs.

 
Modules
            
os
rfc822
tempfile

 
Classes
            
rfc822.Message
Message

 
class Message(rfc822.Message)
      A derived class of rfc822.Message that knows about MIME headers and
contains some hooks for decoding encoded and multipart messages.
 
  
__delitem__(self, name) from rfc822.Message
__getitem__(self, name) from rfc822.Message
__init__(self, fp, seekable=1)
__len__(self) from rfc822.Message
__setitem__(self, name, value) from rfc822.Message
__str__(self) from rfc822.Message
get = getheader(self, name, default=None) from rfc822.Message
getaddr(self, name) from rfc822.Message
getaddrlist(self, name) from rfc822.Message
getallmatchingheaders(self, name) from rfc822.Message
getdate(self, name) from rfc822.Message
getdate_tz(self, name) from rfc822.Message
getencoding(self)
getfirstmatchingheader(self, name) from rfc822.Message
getheader(self, name, default=None) from rfc822.Message
getheaders(self, name) from rfc822.Message
getmaintype(self)
getparam(self, name)
getparamnames(self)
getplist(self)
getrawheader(self, name) from rfc822.Message
getsubtype(self)
gettype(self)
has_key(self, name) from rfc822.Message
iscomment(self, line) from rfc822.Message
isheader(self, line) from rfc822.Message
islast(self, line) from rfc822.Message
items(self) from rfc822.Message
keys(self) from rfc822.Message
parseplist(self)
parsetype(self)
readheaders(self) from rfc822.Message
rewindbody(self) from rfc822.Message
values(self) from rfc822.Message

 
Functions
            
choose_boundary()
Return a random string usable as a multipart boundary.
The method used is so that it is *very* unlikely that the same
string of characters will every occur again in the Universe,
so the caller needn't check the data it is packing for the
occurrence of the boundary.
 
The boundary contains dots so you have to quote it in the header.
copybinary(input, output)
copyliteral(input, output)
decode(input, output, encoding)
Decode common content-transfer-encodings (base64, quopri, uuencode).
encode(input, output, encoding)
Encode common content-transfer-encodings (base64, quopri, uuencode).
pipethrough(input, command, output)
pipeto(input, command)

 
Data
             __all__ = ['Message', 'choose_boundary', 'encode', 'decode', 'copyliteral', 'copybinary']
__file__ = '/usr/lib/python2.1/mimetools.pyc'
__name__ = 'mimetools'
_prefix = None
decodetab = {'base64': 'mmencode -u -b', 'quoted-printable': 'mmencode -u -q', 'uue': '(\nTEMP=/tmp/@uu.$$\nsed "s%^begin [0-7][0-7]* .*%begin 600 $TEMP%" | uudecode\ncat $TEMP\nrm $TEMP\n)', 'uuencode': '(\nTEMP=/tmp/@uu.$$\nsed "s%^begin [0-7][0-7]* .*%begin 600 $TEMP%" | uudecode\ncat $TEMP\nrm $TEMP\n)', 'x-uue': '(\nTEMP=/tmp/@uu.$$\nsed "s%^begin [0-7][0-7]* .*%begin 600 $TEMP%" | uudecode\ncat $TEMP\nrm $TEMP\n)', 'x-uuencode': '(\nTEMP=/tmp/@uu.$$\nsed "s%^begin [0-7][0-7]* .*%begin 600 $TEMP%" | uudecode\ncat $TEMP\nrm $TEMP\n)'}
encodetab = {'base64': 'mmencode -b', 'quoted-printable': 'mmencode -q', 'uue': 'uuencode tempfile', 'uuencode': 'uuencode tempfile', 'x-uue': 'uuencode tempfile', 'x-uuencode': 'uuencode tempfile'}
uudecode_pipe = '(\nTEMP=/tmp/@uu.$$\nsed "s%^begin [0-7][0-7]* .*%begin 600 $TEMP%" | uudecode\ncat $TEMP\nrm $TEMP\n)'