summaryrefslogtreecommitdiffstats
path: root/Lib/mimetypes.py
Commit message (Collapse)AuthorAgeFilesLines
* Apply diff3.txt (plus additional documentation)Walter Dörwald2002-09-061-38/+124
| | | | | | | | | from SF patch http://www.python.org/sf/554192 This adds two new functions to mimetypes: guess_all_extensions() which returns a list of all known extensions for a mime type, and add_type() which adds one mapping between a mime type and an extension.
* SF 563203. Replaced 'has_key()' with 'in'.Raymond Hettinger2002-06-011-6/+6
|
* Separate the script portion from the library portion; everything thatFred Drake2001-12-051-17/+17
| | | | | pertains to the script is now in the if __name__ == "__main__" block. This is in response to a commenton python-dev from Neal Norwitz.
* Applying proposed patch for bug #474583, optional support forBarry Warsaw2001-10-251-132/+212
| | | | | | | | | | | | | | | | | | | non-standard but common types. Including Martin's suggestion to add rejected non-standard types from patch #438790. Specifically, guess_type(), guess_extension(): Both the functions and the methods grow an optional "strict" flag, defaulting to true, which determines whether to recognize non-standard, but commonly found types or not. Also, I sorted, reformatted, and culled duplicates from the big types_map dictionary. Note that there are a few non-equivalent duplicates (e.g. .cdf and .xls) for which the first will just get thrown away. I didn't remove those though. Finally, use of the module as a script as grown the -l and -e options to toggle strictness and to do guess_extension(), respectively. Doc and unittest updates too.
* Patch #438790: Add additional mappings.Martin v. Löwis2001-09-071-3/+36
| | | | Also remove mappings that are not registered with IANA, and not extensions.
* Add some fairly important file extensions: bmp css doc mid midi mp2 mp3 xls.Ka-Ping Yee2001-08-181-0/+8
| | | | Entries taken from the standard Debian mime.types file.
* Another egregious error that copied the encodings info over the suffixFred Drake2001-08-161-1/+1
| | | | info. Caught by the tests that I'm writing now.
* Bad bug: the MimeTypes.readfp() was supposed to take a file object as aFred Drake2001-08-161-2/+2
| | | | | | | | parameter, but did not. This was found because it can create failures elsewhere based on the presence of mime.types files in some common locations the module searches by default. (I will be writing a test for this module shortly!)
* Refactor so that it is easier to work with alternate MIME types databases,Fred Drake2001-08-031-67/+138
| | | | | | and programmatically extend the database in different ways. This closes the SF bug (feature request) #439710.
* Add .pyo as an extension, fixes bug #416462. Also restore alphabetic order.Martin v. Löwis2001-06-051-1/+2
|
* String method conversion. Added a trivial main to test it with.Eric S. Raymond2001-02-091-7/+10
|
* added a few more __all__ listsSkip Montanaro2001-01-251-0/+2
| | | | test___all__.py: fail silently in check_all if the module can't be imported
* Untabify to pass the -tt test.Fred Drake2000-02-101-20/+20
|
* Map .js to application/x-javascript.Fred Drake1999-05-201-0/+1
|
* Added .rdf and .xsl as application/xml types. (.rdf is for theFred Drake1999-03-111-0/+2
| | | | | Resource Description Framework, a metadata encoding, and .xsl is for the Extensible Stylesheet Language.)
* Make mimetypes.guess_type understand data URLs. (Sjoerd Mullender)Guido van Rossum1998-10-121-0/+21
|
* knownfiles: Add the default installation dirs for ApacheFred Drake1998-05-211-0/+2
| | | | versions <= 1.2, >= 1.3.
* guess_extension(): Revise documentation string to be more clear. If notFred Drake1998-05-191-3/+6
| | | | inited, call init().
* guess_extension(): New function. Performs a reverse mapping from MIME typeFred Drake1998-05-181-1/+18
| | | | to filename extension.
* Fixed typo in docstring: suffixes_map --> suffix_map.Fred Drake1998-05-181-1/+1
|
* Add file extension .xml, mapping it to text/xml.Guido van Rossum1998-05-181-0/+1
|
* Mass check-in after untabifying all files that need it.Guido van Rossum1998-03-261-25/+25
|
* Handy utility to guess MIME type from extension.Guido van Rossum1997-09-301-0/+190