The mimeparse module had been included in Python Paste a long time ago.
Not being aware that it was taken from here, I made some improvements to the
module and added unit tests in the Python code base:
http://bitbucket.org/ianb/paste/src/tip/paste/util/mimeparse.py
http://bitbucket.org/ianb/paste/src/tip/tests/test_util/test_mimeparse.py
I have now added a link to the mimeparse project page to the source to make
this clearer, and made my test module also include the test cases provided here.
Maybe you want to backport my version.
Note that I made a small incompatible change to best_match: In case of
ambiguity, my method returns the *first* of the best mime types from the list,
not the *last* one. I think this makes more sense. I have also mentioned this
in the docstring.
Original issue reported on code.google.com by ch.zwerschke@gmail.com on 19 Aug 2010 at 4:32
Original issue reported on code.google.com by
ch.zwerschke@gmail.com
on 19 Aug 2010 at 4:32