| mimetypes | index /usr/lib/python1.6/mimetypes.py |
Guess the MIME type of a file.
This module defines two useful functions:
guess_type(url) -- guess the MIME type and encoding of a URL.
guess_extension(type) -- guess the extension for a given MIME type.
It also contains the following, for tuning the behavior:
Data:
knownfiles -- list of files to parse
inited -- flag set when init() has been called
suffixes_map -- dictionary mapping suffixes to suffixes
encodings_map -- dictionary mapping suffixes to encodings
types_map -- dictionary mapping suffixes to types
Functions:
init([files]) -- parse a list of files, default knownfiles
read_mime_types(file) -- parse one file, return a dictionary or None
| Modules | ||||||
| ||||||
| Functions | ||
| ||
| Data | ||
| __file__ = '/usr/lib/python1.6/mimetypes.pyc' __name__ = 'mimetypes' encodings_map = {'.Z': 'compress', '.gz': 'gzip'} inited = 0 knownfiles = ['/usr/local/etc/httpd/conf/mime.types', '/usr/local/lib/netscape/mime.types', '/usr/local/etc/httpd/conf/mime.types', '/usr/local/etc/mime.types'] suffix_map = {'.taz': '.tar.gz', '.tgz': '.tar.gz', '.tz': '.tar.gz'} types_map = {'.a': 'application/octet-stream', '.ai': 'application/postscript', '.aif': 'audio/x-aiff', '.aifc': 'audio/x-aiff', '.aiff': 'audio/x-aiff', '.au': 'audio/basic', '.avi': 'video/x-msvideo', '.bcpio': 'application/x-bcpio', '.bin': 'application/octet-stream', '.cdf': 'application/x-netcdf', ...} | ||