Skip to Content
Python: Essential Reference, Third Edition
book

Python: Essential Reference, Third Edition

by David Beazley
February 2006
Intermediate to advanced content levelIntermediate to advanced
648 pages
14h 53m
English
Sams
Content preview from Python: Essential Reference, Third Edition

mailcap

The mailcap module is used to read UNIX mailcap files. Mailcap files are used to tell mail readers and web browsers how to process files with different MIME types. The contents of a mailcap file typically look something like this:

video/mpeg; xmpeg %s
application/pdf; acroread %s

When data of a given MIME type is encountered, the mailcap file is consulted to find an application for handling that data.

getcaps()

Reads all available mailcap files and returns a dictionary mapping MIME types to a mailcap entry. mailcap files are read from $HOME/.mailcap, /etc/mailcap, /usr/etc/mailcap, and /usr/local/etc/mailcap.

findmatch(caps, mimetype [, key [, filename [, plist]]])

Searches the dictionary caps for a mailcap entry matching mimetype. The ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python: Essential Reference

Python: Essential Reference

David M. Beazley

Publisher Resources

ISBN: 0672328623Purchase book