{ "info": { "author": "David Glick", "author_email": "dglick@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Code Generators" ], "description": "Overview\n--------\n\nmr.igor is an extension to pyflakes that will learn where you import\nthings from, and then automatically fill in missing imports from the\nplace they are most often imported.\n\nBut how does it know?\n\n \"It'th a knack.\"\n\nUsage: igor [--print | --reap] filename\n\nThis script will record all imports from filename in Igor's database,\nand then add imports at the top of the file for any names that were not\nimported but were found in the database.\n\nIf the --print option is specified then the rewritten file will be\nwritten to stdout. (This allows the use of igor as a filter for editors.)\nOtherwise the file will be modified inplace.\n\nIf the --reap option is specified then imports will be added to the\ndatabase from the specified file, but nothing will be written to stdout\nand the file will not be modified.\n\nOnly \"from x import y\" style imports are tracked and inserted. Aliases\n(\"from x import y as z\") are not supported.\n\nmr.igor stores its database in the user's home directory. The base filename is\n~/.mr.igor, but note that the Python shelve module may use a different physical\nfilename, e.g. with a .db suffix.\n\n\nUsage with TextMate\n-------------------\n\nGo to the TextMate Bundle Editor and add a new command with the following\nsettings:\n\n Save\n Current File\n Command(s)\n ::\n \n #!/bin/bash\n igor --print $TM_FILEPATH\n Input\n None\n Output\n Replace Document\n Activation\n Key Equivalent: \u2318I\n Scope Selector\n source.python\n\nNow you can save the current file and run it through Igor using the \u2318I\nkeyboard shortcut.\n\nUsage with Vim\n--------------\n\nThe following key mapping will configure \u2318I to run the current file through\nIgor and then reload the current buffer::\n\n nmap :!igor % :e!\n\nUsage with Emacs\n----------------\n\nAdd the following to your .emacs. The ``igor`` function runs Igor over a\ntemporary file copy of the current buffer. The current buffer is marked as\nmodified only if Igor adds new imports.\n\n::\n\n (defun igor ()\n \"Run the current buffer through mr.igor.\"\n (interactive)\n (let ((igor-exe (or (executable-find \"igor\")\n (error \"No command 'igor' found\")))\n (tempfile (make-temp-file \"igor\"))\n (buffer (current-buffer))\n (lines-before (count-lines 1 (buffer-size))))\n (with-temp-file tempfile\n (insert-buffer-substring buffer))\n (with-temp-buffer\n (shell-command (concat igor-exe \" --print \" tempfile) t)\n (if (zerop (compare-buffer-substrings\n (current-buffer) 1 (buffer-size)\n buffer 1 (buffer-size buffer)))\n (message \"igor: no new imports\")\n (copy-to-buffer buffer 1 (buffer-size))\n (let ((lines-after (count-lines 1 (buffer-size))))\n (message \"igor: added %d imports\" (- lines-after lines-before))))\n (delete-file tempfile))))\n\n (add-hook 'python-mode-hook '(lambda () (local-set-key (kbd \"C-c C-i\") 'igor)))\n\nChangelog\n=========\n\n2013/10/05\n\n- Released version 1.4. [davisagli]\n- ImportChecker's __del__ isn't called with pyflakes 0.7 so the database is\n never written. Switch to a with() statement, where the __exit__ method is\n guaranteed to be called.\n [danjacka]\n\n2011/10/2\n\n- Released version 1.3. [davisagli]\n- Insert imports after initial set of comments, to fix issue when\n PEP0263 encoding is declared in python files. [naro]\n- Updated to be compatible with (and require) pyflakes 0.5.\n Tested with Python 2.6 and 2.7.\n [davisagli]\n\n2010/1/7\n\n- Released version 1.2. [davisagli]\n- Added --reap option. [davisagli]\n\n2009/12/14\n\n- Added usage info for integration with Vim. Thanks to Stephan Eletzhofer.\n [davisagli]\n- Released version 1.1. [davisagli]\n- Fix issue where a syntax error would cause the file to be clobbered when\n using print mode as a filter. [davisagli]\n- Fix issue where print mode would not print anything if no new imports were\n found. [davisagli]\n- Fix issue where multiple imports in the same line were not recorded.\n [davisagli]\n- Released version 1.0. [davisagli]\n- Added functional test. [davisagli]\n- Refactor to improve testability; avoid monkeypatching. [davisagli]\n\n2009/12/13\n\n- Add help for console script. [davisagli]\n- Use ~/.mr.igor.db as default database location. [davisagli]\n- Added --print option. [davisagli]\n- Added igor console script. [davisagli]\n\n2009/12/12\n\n- Initial proof-of-concept. [davisagli]", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/davisagli/mr.igor", "keywords": "python imports automatic", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "mr.igor", "package_url": "https://pypi.org/project/mr.igor/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mr.igor/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/davisagli/mr.igor" }, "release_url": "https://pypi.org/project/mr.igor/1.4/", "requires_dist": null, "requires_python": null, "summary": "Mr. Igor provides the parts you need to build your Frankenprogram.", "version": "1.4" }, "last_serial": 882019, "releases": { "0.1": [], "1.0": [ { "comment_text": "", "digests": { "md5": "f387e795480c1a6e1e2fdd4f9a10ff83", "sha256": "b4749022ea443498717afdc2211faabc227eccf61c57a3a4a21f6a2be6d13cfa" }, "downloads": -1, "filename": "mr.igor-1.0.zip", "has_sig": false, "md5_digest": "f387e795480c1a6e1e2fdd4f9a10ff83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9080, "upload_time": "2009-12-14T09:45:06", "url": "https://files.pythonhosted.org/packages/91/e0/09be9e352c982bcb93a606052c2d4e15f507bb0c547ee1cb867c80bbc816/mr.igor-1.0.zip" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "c4f4ef0bfb919b6ac524e1563aad7078", "sha256": "8d9a819ea7c56723cc0e69022ae4f74e00e60c005a875dfc9159f75be35f6186" }, "downloads": -1, "filename": "mr.igor-1.1.zip", "has_sig": false, "md5_digest": "c4f4ef0bfb919b6ac524e1563aad7078", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9749, "upload_time": "2009-12-14T22:10:53", "url": "https://files.pythonhosted.org/packages/13/d3/e245aa601230017414a30f86ddd9e10da2c145d658db8831d40ba4c7e396/mr.igor-1.1.zip" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "0bcd232cb76b58994c6e6298fee0f07c", "sha256": "2ac8079c5ced508076c8cdc84531c888e289be2fc59ac616dc46c6cd29f8849c" }, "downloads": -1, "filename": "mr.igor-1.2.zip", "has_sig": false, "md5_digest": "0bcd232cb76b58994c6e6298fee0f07c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10414, "upload_time": "2010-01-08T06:59:32", "url": "https://files.pythonhosted.org/packages/9a/31/d39e4db279d5754594d8b0aaa9e60aa3d89b13c77a6264619adf4e7ead95/mr.igor-1.2.zip" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "7ca46f1a5d004bcaa6012bc52fe1e83c", "sha256": "faeb00486d425b755b0f4052c55b3ee1faf4255ed0124bb9046334282a9eeb48" }, "downloads": -1, "filename": "mr.igor-1.3.zip", "has_sig": false, "md5_digest": "7ca46f1a5d004bcaa6012bc52fe1e83c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11203, "upload_time": "2011-10-03T06:48:45", "url": "https://files.pythonhosted.org/packages/45/bd/feb4203f90755a599f18db4e270ae2680068d53444b00e0ef3ee31d5439d/mr.igor-1.3.zip" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "ac3c2d0767769fc87ad76d4b8cf1d8fb", "sha256": "d40b46aee638a03879c9a7a61a50d2039e44bfd8244e385e4f73e16f2d855efb" }, "downloads": -1, "filename": "mr.igor-1.4.zip", "has_sig": false, "md5_digest": "ac3c2d0767769fc87ad76d4b8cf1d8fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13252, "upload_time": "2013-10-05T19:00:59", "url": "https://files.pythonhosted.org/packages/9d/c8/d10eb71ec7277d0bb6ef73a21a923931927e94d3dc7ad607eb7d282f729e/mr.igor-1.4.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ac3c2d0767769fc87ad76d4b8cf1d8fb", "sha256": "d40b46aee638a03879c9a7a61a50d2039e44bfd8244e385e4f73e16f2d855efb" }, "downloads": -1, "filename": "mr.igor-1.4.zip", "has_sig": false, "md5_digest": "ac3c2d0767769fc87ad76d4b8cf1d8fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13252, "upload_time": "2013-10-05T19:00:59", "url": "https://files.pythonhosted.org/packages/9d/c8/d10eb71ec7277d0bb6ef73a21a923931927e94d3dc7ad607eb7d282f729e/mr.igor-1.4.zip" } ] }