{ "info": { "author": "Michael Lazar", "author_email": "lazar.michael22@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "===========\nMailcap Fix\n===========\n\n|pypi| |python| |travis-ci|\n\n| **Note**\n| A fix has now been merged into `Python 3.6.0 `_.\n| This package remains as a backport for previous versions.\n\nSummary\n-------\n\nThis package patches the python standard library's \n`mailcap `_ module in order\nto correctly handle windcard entries.\n\nThe bug is documented on the bug tracker here: `issue 14977 `_\n\nInstallation\n------------\n\n.. code-block:: bash\n\n $ pip install mailcap-fix\n \nExample\n-------\n\nConsider a mailcap file that contains the following two lines\n\n::\n\n image/*; feh %s\n image/jpeg; eog %s\n\nBecause the **image/*** entry is defined first, it should take\nprecedence over the **image/jpeg** entry when searching for a match.\nThis behavior is defined by `RFC 1524 `_.\nHowever, the standard library's implementation will always evaluate\nwildcard entries last.\n\n**Before**\n\n.. code-block:: python\n\n >>> import mailcap\n >>> d = mailcap.getcaps()\n >>> # Incorrectly returns the second entry\n >>> mailcap.findmatch(d, 'image/jpeg', filename='test.jpg')\n ('eog test.jpg', {'view': 'eog %s'})\n\n**After**\n\n.. code-block:: python\n\n >>> from mailcap_fix import mailcap\n >>> d = mailcap.getcaps()\n >>> # Correctly returns the wildcard entry\n >>> mailcap.findmatch(d, 'image/jpeg', filename='test.jpg')\n ('feh test.jpg', {'view': 'feh %s', 'lineno': 0})\n\nHow it works\n------------\n\nThe goal of this patch is to conform to RFCC 1524,\nwhile preserving as much backwards compatibility as possible and without adding any \"magic\".\n\n*mailcap_fix* adds a new field ``lineno`` to each entry in the mailcap dict.\nThis line number is then used to sort entries in descending order when searching for a match.\nFor backwards compatability, if ``lineno`` is not present entries will simply not be sorted.\nBecause RFC 1524 defines a whitelist of valid mailcap fieldnames, the addition of ``lineno``\nshould not conflict with any other mailcap fields.\n\nBenchmark\n---------\n\n| *Python 3.4.0*\n| *Ubuntu 14.04 LTS 64bit*\n| *Intel\u00ae Core\u2122 i5-3210M CPU @ 2.50GHz \u00d7 4*\n| *8 GiB RAM*\n|\n\n==================== ============ ============\n mailcap.get_caps() - per file\n----------------------------------------------\n.. mailcap mailcap_fix\n==================== ============ ============\nmailcap_short.txt_ 0.081881 ms 0.084525 ms\nmailcap_long.txt_ 17.746289 ms 18.407623 ms\n==================== ============ ============\n\n==================== =========== ===========\n mailcap.lookup() - avg function call\n--------------------------------------------\n.. mailcap mailcap_fix\n==================== =========== ===========\nmailcap_short.txt_ 0.000996 ms 0.003144 ms\nmailcap_long.txt_ 0.000798 ms 0.002731 ms\n==================== =========== ===========\n\n.. _mailcap_short.txt: https://github.com/michael-lazar/mailcap_fix/blob/master/tests/data/mailcap_short.txt\n\n.. _mailcap_long.txt: https://github.com/michael-lazar/mailcap_fix/blob/master/tests/data/mailcap_long.txt\n\n.. |python| image:: https://img.shields.io/badge/python-2.6+%2C%203.0+%2C%20pypy-blue.svg\n :target: https://pypi.python.org/pypi/mailcap_fix/\n :alt: Supported Python versions\n\n.. |pypi| image:: https://img.shields.io/pypi/v/mailcap_fix.svg?label=version\n :target: https://pypi.python.org/pypi/mailcap_fix/\n :alt: Latest Version\n\n.. |travis-ci| image:: https://travis-ci.org/michael-lazar/mailcap_fix.svg?branch=master\n :target: https://travis-ci.org/michael-lazar/mailcap_fix\n :alt: Build", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/michael-lazar/mailcap_fix", "keywords": "mailcap 1524", "license": "UNLICENSE", "maintainer": null, "maintainer_email": null, "name": "mailcap-fix", "package_url": "https://pypi.org/project/mailcap-fix/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mailcap-fix/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/michael-lazar/mailcap_fix" }, "release_url": "https://pypi.org/project/mailcap-fix/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "A patched mailcap module that conforms to RFC 1524", "version": "1.0.1" }, "last_serial": 2547078, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5710a478c72a9e13061d7c41ce7327d9", "sha256": "16d18547fe1e522c6998eb3e48e8fca40dcc9e70aba4c936fca98bbc32c42148" }, "downloads": -1, "filename": "mailcap_fix-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5710a478c72a9e13061d7c41ce7327d9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10100, "upload_time": "2016-07-11T00:04:20", "url": "https://files.pythonhosted.org/packages/9f/5b/ff4bfd08cf760e687a7f88efa8850804d004b7a23fd9d3699ca70b5b52a6/mailcap_fix-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "abd58907b0991e3d983123a3382eb551", "sha256": "1a5cc18f0677299791e14892f805860d327ae6b4d799cd27d935881835702909" }, "downloads": -1, "filename": "mailcap-fix-0.1.0.tar.gz", "has_sig": false, "md5_digest": "abd58907b0991e3d983123a3382eb551", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6473, "upload_time": "2016-07-11T00:04:15", "url": "https://files.pythonhosted.org/packages/6e/cb/acdc243474ab367916f2ffbfceb3d0fdd0fd367fce47016aa8b13f46ba58/mailcap-fix-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "2d1ee1eb12e05564be95984a32528740", "sha256": "552249b3a8a7a188d9e7dd88857efece0c685b334e97d64b16a07a8c1482eb35" }, "downloads": -1, "filename": "mailcap_fix-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2d1ee1eb12e05564be95984a32528740", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10077, "upload_time": "2016-07-12T04:59:39", "url": "https://files.pythonhosted.org/packages/f0/57/934793d0ad8b2964969675829ea0c6b35a73e75ee006802d8a82a316601c/mailcap_fix-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d6d9fa9d33aa36755b1fe70ec1390e03", "sha256": "a0872cfc743095bc66e2b8881c74f94a5ad02a77b54198f358bff731cf93e968" }, "downloads": -1, "filename": "mailcap-fix-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d6d9fa9d33aa36755b1fe70ec1390e03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6084, "upload_time": "2016-07-12T04:59:12", "url": "https://files.pythonhosted.org/packages/fe/16/05d004192773a2aa6c7ef3b2f0225f6e392f055852d94366735dc1673372/mailcap-fix-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "9a99b63f80aeb61ae5157e8a0f892263", "sha256": "4ae220bf21ec42efbafc5f1c88fbe3c4b9087e341132cc4195667729dd3a34e1" }, "downloads": -1, "filename": "mailcap_fix-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9a99b63f80aeb61ae5157e8a0f892263", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10083, "upload_time": "2016-07-27T06:44:45", "url": "https://files.pythonhosted.org/packages/ee/d3/183149d73ac0c8f127055c2a3e081ab4b0a9bf3f93dda4b36034827e682b/mailcap_fix-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bdfcaf0b6951aaabba8bb6f34739b504", "sha256": "9c4f81c3b3efe0cedfb1283ec231184747e359e9eaeee70a9757dcda1908bcef" }, "downloads": -1, "filename": "mailcap-fix-0.1.2.tar.gz", "has_sig": false, "md5_digest": "bdfcaf0b6951aaabba8bb6f34739b504", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6096, "upload_time": "2016-07-27T06:44:43", "url": "https://files.pythonhosted.org/packages/17/9e/bde70507f34f9f153e2aeb29676e615427627d2391c4626001974cac96ff/mailcap-fix-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "8fcca3290cc533b987bb9857fe98fda2", "sha256": "9fa4dd4489fd97652834cd60feff7f35fe2b1d1dba502d7fec91751d2c4890f8" }, "downloads": -1, "filename": "mailcap_fix-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8fcca3290cc533b987bb9857fe98fda2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10130, "upload_time": "2016-08-08T00:11:06", "url": "https://files.pythonhosted.org/packages/e9/da/87db585e26fefc346adaba453069c67fb2b9fa99648ad1770ad7f640434f/mailcap_fix-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "64e7f8490db30bd2c8e452ed2ccf9f12", "sha256": "13b33059db4f3d5cd76ed173fb892dd59625075d6ec528e896840db39fb3b436" }, "downloads": -1, "filename": "mailcap-fix-0.1.3.tar.gz", "has_sig": false, "md5_digest": "64e7f8490db30bd2c8e452ed2ccf9f12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6143, "upload_time": "2016-08-08T00:11:03", "url": "https://files.pythonhosted.org/packages/8c/2a/db1c970c05e65dd8e0ab76d2d3efa3a4b86417d16bc60efc8d8ce075835f/mailcap-fix-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "3d1e66c188a5a88ad6e28c6b9f41c08e", "sha256": "325561be29c3d8e5e1059ec95e53f88c8883b4944fcc9450f7aab4c6c2ea4f2f" }, "downloads": -1, "filename": "mailcap_fix-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3d1e66c188a5a88ad6e28c6b9f41c08e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10207, "upload_time": "2016-09-11T22:41:30", "url": "https://files.pythonhosted.org/packages/81/64/2ea99084389dfcc00a3d0e18dad18429c0218fe3af9af0db41db98ea5912/mailcap_fix-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ed01e352325834112e95ffeb92e72fb1", "sha256": "0fc57a701801cd31c45a8f0a661144085b4b0c56b8990c74f9af02af1d0feb60" }, "downloads": -1, "filename": "mailcap-fix-0.2.0.tar.gz", "has_sig": false, "md5_digest": "ed01e352325834112e95ffeb92e72fb1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6223, "upload_time": "2016-09-11T22:41:27", "url": "https://files.pythonhosted.org/packages/2e/44/79b536cf6659c8a93ac3aa988726c0dbfc84fa35ac40910795ec83dcbe0e/mailcap-fix-0.2.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "4c17f8b212c359883b645e7d84a82966", "sha256": "bade9a6afa53e5e0413ffa7cbc43815706471ca5d56c12b1f8a18f6bcd916f66" }, "downloads": -1, "filename": "mailcap_fix-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4c17f8b212c359883b645e7d84a82966", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10418, "upload_time": "2016-12-31T01:28:40", "url": "https://files.pythonhosted.org/packages/32/78/f14e5567925adf0806eec9c9efbf74c216a4ab86660b9f847bd74a35adf1/mailcap_fix-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "834b231718e4d6fb4505d9f9260a7f41", "sha256": "6370e0cd5ba447fe1e9ee2047391904951a64f07cd94db14ca46cd1df5298a8a" }, "downloads": -1, "filename": "mailcap-fix-1.0.0.tar.gz", "has_sig": false, "md5_digest": "834b231718e4d6fb4505d9f9260a7f41", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6335, "upload_time": "2016-12-31T01:28:38", "url": "https://files.pythonhosted.org/packages/6b/3e/e0132fa00247e7a2bb9ebb2e4c7e55d9322a153d43942b0620fbd529078d/mailcap-fix-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "f2eb0a626287d716bd913f444c2910ea", "sha256": "fd1371d9599fde5724037a02caede75da1b8b425f10da710d1b7798ac14b2540" }, "downloads": -1, "filename": "mailcap_fix-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f2eb0a626287d716bd913f444c2910ea", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10420, "upload_time": "2016-12-31T01:40:28", "url": "https://files.pythonhosted.org/packages/0b/0d/321abc5ca1efb647b51611bda34d6884099d390492c4627dc8b4c2322ff7/mailcap_fix-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "56261055ca49cd42f7e26809b835e802", "sha256": "113c0b36091ac0b8181c33f2cd4905280e1bb316383d3c3fcae98c6df094910a" }, "downloads": -1, "filename": "mailcap-fix-1.0.1.tar.gz", "has_sig": false, "md5_digest": "56261055ca49cd42f7e26809b835e802", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6343, "upload_time": "2016-12-31T01:40:25", "url": "https://files.pythonhosted.org/packages/c2/e5/55485018f29af549d94e7a52ce9271ec88ff5f5f2f8246bcc7ce13e3897f/mailcap-fix-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f2eb0a626287d716bd913f444c2910ea", "sha256": "fd1371d9599fde5724037a02caede75da1b8b425f10da710d1b7798ac14b2540" }, "downloads": -1, "filename": "mailcap_fix-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f2eb0a626287d716bd913f444c2910ea", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10420, "upload_time": "2016-12-31T01:40:28", "url": "https://files.pythonhosted.org/packages/0b/0d/321abc5ca1efb647b51611bda34d6884099d390492c4627dc8b4c2322ff7/mailcap_fix-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "56261055ca49cd42f7e26809b835e802", "sha256": "113c0b36091ac0b8181c33f2cd4905280e1bb316383d3c3fcae98c6df094910a" }, "downloads": -1, "filename": "mailcap-fix-1.0.1.tar.gz", "has_sig": false, "md5_digest": "56261055ca49cd42f7e26809b835e802", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6343, "upload_time": "2016-12-31T01:40:25", "url": "https://files.pythonhosted.org/packages/c2/e5/55485018f29af549d94e7a52ce9271ec88ff5f5f2f8246bcc7ce13e3897f/mailcap-fix-1.0.1.tar.gz" } ] }