{ "info": { "author": "Todd Wolfson", "author_email": "todd@twolfson.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: Public Domain", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Text Editors" ], "description": "sublime-harness\n===============\n\n.. image:: https://travis-ci.org/twolfson/sublime-harness.png?branch=master\n :target: https://travis-ci.org/twolfson/sublime-harness\n :alt: Build Status\n\nRun Python in Sublime Text from outside of Sublime Text\n\n``sublime-harness`` was built to allow for execution of arbitrary Python within the context of `Sublime Text`_. It is also part of the `Sublime plugin tests`_ framework.\n\n.. _`Sublime Text`: http://sublimetext.com/\n.. _`Sublime plugin tests`: https://github.com/twolfson/sublime-plugin-tests\n\n Currently, only Linux is supported but OSX and Windows support are planned.\n\nDeprecation notice\n==================\nWe have decided to deprecate ``sublime-harness`` in favor of `randy3k/UnitTesting`_.\n\nIt has greater platform support and a less brittle design for local development.\n\nhttps://github.com/randy3k/UnitTesting\n\n.. _`randy3k/UnitTesting`: https://github.com/randy3k/UnitTesting\n\nGetting Started\n---------------\nInstall the module with: ``pip install sublime_harness``\n\n.. code:: python\n\n import os, time\n from sublime_harness import Harness\n\n harness = Harness()\n script = \"\"\"\n import sublime\n\n # Harness will run the `run` function\n def run():\n with open('/tmp/hi', 'w') as f:\n f.write('Hello World!')\n sublime.run_command('exit')\"\"\"\n harness.run(script)\n\n # Wait for our file to exist (Sublime Text is forked and not synchronous)\n output_file = '/tmp/hi'\n while (not os.path.exists(output_file) or\n os.stat(output_file).st_size == 0):\n time.sleep(0.1)\n\n # Read our data\n with open(output_file) as f:\n print f.read() # Hello World!\n\nDocumentation\n-------------\n``sublime_harness`` provides the ``Harness`` class for all your bootstrapping needs.\n\n`Sublime Text`_ will be resolved via `sublime-info`_, which allows for overriding via environment variables.\n\n.. _`sublime-info`: https://github.com/twolfson/sublime-info\n\nHarness.__init__\n^^^^^^^^^^^^^^^^\n.. code:: python\n\n Harness()\n \"\"\"Generate a new Harness for Sublime Text\n\n When initialized, `Harness` allocates a directory (currently,\n same for all harnesses) for your script.\n \"\"\"\n\nHarness.directory\n^^^^^^^^^^^^^^^^^\n.. code:: python\n\n harness.directory\n \"\"\"Directory where `run` will be execute\n\n If you would like to load relative modules, they should be copied to this directory.\"\"\"\n\nHarness.run\n^^^^^^^^^^^\n.. code:: python\n\n harness.run(script)\n \"\"\"Python to execute within the context of Sublime Text\n\n **YOU MUST CLEAN UP AFTER RUNNING THIS METHOD VIA `close`**\n\n You can only run one harness at a time due to the lack of namespacing.\n\n :param script: Python to execute within Sublime Text\n :type script: str\n \"\"\"\n\nHarness.close\n^^^^^^^^^^^^^\n.. code:: python\n\n harness.close()\n \"\"\"Cleans up harness files\"\"\"\n\nExamples\n--------\nAs mentioned within ``Harness.dictionary``, external files can be loaded relatively to the script. This is an example of how to set up and use them.\n\n.. code:: python\n\n # Set up a new harness\n import os, time\n from sublime_harness import Harness\n harness = Harness()\n\n # Copy over a local file to the directory\n dest_hello_path = harness.directory + '/hello.py'\n with open(dest_hello_path, 'w') as f:\n f.write('hello = \"World!\"')\n\n # Generate and run our temporary task\n script = \"\"\"\n import os\n import sublime\n\n try :\n from hello import hello # ST 2 compatible\n except:\n from .hello import hello # ST 3 compatible\n\n def run():\n with open('/tmp/hi-directory', 'w') as f:\n f.write(hello)\n sublime.run_command('exit')\n \"\"\"\n\n harness.run(script)\n output_file = '/tmp/hi-directory'\n while (not os.path.exists(output_file) or\n os.stat(output_file).st_size == 0):\n time.sleep(0.1)\n\n # Grab the file output\n with open(output_file) as f:\n print f.read() # 'World!'\n\n # Remove the plugin and our file\n harness.close()\n os.unlink(dest_hello_path)\n\nContributing\n------------\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Test via ``nosetests``.\n\nDonating\n--------\nSupport this project and `others by twolfson`_ via `gittip`_.\n\n.. image:: https://rawgithub.com/twolfson/gittip-badge/master/dist/gittip.png\n :target: `gittip`_\n :alt: Support via Gittip\n\n.. _`others by twolfson`:\n.. _gittip: https://www.gittip.com/twolfson/\n\nUnlicense\n---------\nAs of Oct 16 2013, Todd Wolfson has released this repository and its contents to the public domain.\n\nIt has been released under the `UNLICENSE`_.\n\n.. _UNLICENSE: https://github.com/twolfson/sublime-harness/blob/master/UNLICENSE", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/twolfson/sublime-harness/archive/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/twolfson/sublime-harness", "keywords": "sublime text,harness,runner", "license": "UNLICENSE", "maintainer": null, "maintainer_email": null, "name": "sublime_harness", "package_url": "https://pypi.org/project/sublime_harness/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/sublime_harness/", "project_urls": { "Download": "https://github.com/twolfson/sublime-harness/archive/master.zip", "Homepage": "https://github.com/twolfson/sublime-harness" }, "release_url": "https://pypi.org/project/sublime_harness/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "Run Python in Sublime Text from outside of Sublime Text", "version": "1.0.0" }, "last_serial": 1881951, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "57a0c7827d820e9b5323d0d6ee83f350", "sha256": "98c2071a8e395e2a54c3b2fa262b019093c054cd88391cee99c41bba40742a22" }, "downloads": -1, "filename": "sublime_harness-0.1.0.tar.gz", "has_sig": false, "md5_digest": "57a0c7827d820e9b5323d0d6ee83f350", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11631, "upload_time": "2013-11-07T11:17:44", "url": "https://files.pythonhosted.org/packages/a4/6c/21e84ffbb084c9f6ec446848db1b7c416579003ea556c889aabc3d751c51/sublime_harness-0.1.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "568c18ceb67fbd9d2c33159a6a18a47a", "sha256": "6bf0293036a14a653c3345af1cea740488a0898d84aafa4531af3e37f6e1be0b" }, "downloads": -1, "filename": "sublime_harness-0.1.0.zip", "has_sig": false, "md5_digest": "568c18ceb67fbd9d2c33159a6a18a47a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19514, "upload_time": "2013-11-07T11:17:46", "url": "https://files.pythonhosted.org/packages/e2/8e/e7bee4af3d31e44457fe809f7d76ddc523c61a6d28eb5d43d1b59279eb25/sublime_harness-0.1.0.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b6e44723a94fb8a07da61223c57de311", "sha256": "80a9ee9f9d0aa37aab48ab9fb3ddd564e97ae0002d2485a5ac02c803dfee2d2c" }, "downloads": -1, "filename": "sublime_harness-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b6e44723a94fb8a07da61223c57de311", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11672, "upload_time": "2013-11-22T08:15:23", "url": "https://files.pythonhosted.org/packages/35/fc/ea9b83b58c1d6c700e08967e8767fc0118e7e3464de250e583385c9fb04e/sublime_harness-0.1.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "801a9d6360d4fc87b9d2bdeec06d3417", "sha256": "3f72a62e54455943dc664a155cfeac13a45ce9a443a12811623e21f82d453652" }, "downloads": -1, "filename": "sublime_harness-0.1.1.zip", "has_sig": false, "md5_digest": "801a9d6360d4fc87b9d2bdeec06d3417", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19561, "upload_time": "2013-11-22T08:15:26", "url": "https://files.pythonhosted.org/packages/7c/71/386bfba8ccd6a9eb56a537776180ce87537afcc13d91226d452d37205e1d/sublime_harness-0.1.1.zip" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "89acde54a0feeb470bf65cd4a463c4cd", "sha256": "eade7bd1ad51dcc60a464197d5b202a127f133ccb2d859c6002d120d284ce1d3" }, "downloads": -1, "filename": "sublime_harness-0.2.0.tar.gz", "has_sig": false, "md5_digest": "89acde54a0feeb470bf65cd4a463c4cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11949, "upload_time": "2013-12-23T01:46:02", "url": "https://files.pythonhosted.org/packages/aa/90/50058ab155d96041794032ca2ad4df429ceeccb11f37d38c0fb067fb1eb3/sublime_harness-0.2.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "091232ab14f1e8f950f43b75beca0607", "sha256": "7bcf319e86b95c7bce320306256c99a7b1a361a980b362cdb4369bff06067f0f" }, "downloads": -1, "filename": "sublime_harness-0.2.0.zip", "has_sig": false, "md5_digest": "091232ab14f1e8f950f43b75beca0607", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19867, "upload_time": "2013-12-23T01:46:04", "url": "https://files.pythonhosted.org/packages/37/b4/3908f1750c7e5da8dca74e3364593afafe4b4acd064288588ed42d655086/sublime_harness-0.2.0.zip" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "92eb24f9acf83e6060110c83341128f3", "sha256": "458cb544c7eb441a652fd90ec7c86af1db458e0a6d122155c3253a850d6d0ef7" }, "downloads": -1, "filename": "sublime_harness-0.3.0.tar.gz", "has_sig": false, "md5_digest": "92eb24f9acf83e6060110c83341128f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11713, "upload_time": "2013-12-23T08:27:14", "url": "https://files.pythonhosted.org/packages/d5/00/37cc69caccb1b9f8dd0c91540235445d098c81bfb64029795eefc232c9d2/sublime_harness-0.3.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "b8da018d05f6ebf212ac7d010cb4fe1d", "sha256": "16f0fc90b69fe2cbb4001c1e4625dce497dacb0d57159fbb0e115447ada9e328" }, "downloads": -1, "filename": "sublime_harness-0.3.0.zip", "has_sig": false, "md5_digest": "b8da018d05f6ebf212ac7d010cb4fe1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19636, "upload_time": "2013-12-23T08:27:17", "url": "https://files.pythonhosted.org/packages/b9/fe/bc6d505ddb63b1515c6da8e1487abda464e5e630382ba907c9efbcfd9705/sublime_harness-0.3.0.zip" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "c022c91fd3cb9de7d31e8446512eb4bf", "sha256": "2f1cf3a2dc43f72f9a0f0aae3eb6bc08387839e3f408f433aaa990d8521971cc" }, "downloads": -1, "filename": "sublime_harness-0.4.0.tar.gz", "has_sig": false, "md5_digest": "c022c91fd3cb9de7d31e8446512eb4bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11774, "upload_time": "2013-12-25T00:15:30", "url": "https://files.pythonhosted.org/packages/39/e9/8df95d3cf6a3c24edf47cddb9e44c2e69c744986fdc27c722cfd4799b602/sublime_harness-0.4.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "7b53c857262ab3234be9f2b0b5841221", "sha256": "4da61167473c6e8f221e8b91053afd48e825a38cdb9fd6cb2efa13c91016ef4e" }, "downloads": -1, "filename": "sublime_harness-0.4.0.zip", "has_sig": false, "md5_digest": "7b53c857262ab3234be9f2b0b5841221", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19759, "upload_time": "2013-12-25T00:15:32", "url": "https://files.pythonhosted.org/packages/b2/73/fd2a1f9cdb88ec04640d243f79ce0a1304acc094cd0e3e8822dcfe8aa5ed/sublime_harness-0.4.0.zip" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "fd42e994000c23696b41c3bbe2936901", "sha256": "08ef31df57ab9bf973571a152a79ba3f13cc241ec83e461dfdf992a6fac4d946" }, "downloads": -1, "filename": "sublime_harness-0.4.1.tar.gz", "has_sig": false, "md5_digest": "fd42e994000c23696b41c3bbe2936901", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11826, "upload_time": "2014-02-26T08:46:19", "url": "https://files.pythonhosted.org/packages/05/fd/4af82af1970f36b5d4cf68d76eea374885d9db9f6d4e2cbeea17cb561c76/sublime_harness-0.4.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "aa58a34993a13ad8f8ec03c400fadab4", "sha256": "462a8b29ca891f146af2ad43b0614a7d1a7699595d15314fa5219b7a9c931229" }, "downloads": -1, "filename": "sublime_harness-0.4.1.zip", "has_sig": false, "md5_digest": "aa58a34993a13ad8f8ec03c400fadab4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19802, "upload_time": "2014-02-26T08:46:22", "url": "https://files.pythonhosted.org/packages/b9/c1/cfc8b9c4b9a35fc23573fb2691eac7f1bdd4232ee0f6a24d1821a38f55a2/sublime_harness-0.4.1.zip" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "825b5fc5f7d90b6703fc8cd9c8bc7445", "sha256": "66e9b05fb05cb5b41eb02a4fa32c7ab87eba3fee6cd6d8aa87f4c3868158e9c0" }, "downloads": -1, "filename": "sublime_harness-0.4.2.tar.gz", "has_sig": false, "md5_digest": "825b5fc5f7d90b6703fc8cd9c8bc7445", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8705, "upload_time": "2015-12-30T03:39:12", "url": "https://files.pythonhosted.org/packages/e0/85/68cdad9eb4d7d42c554c5f0b6a972afb010d69f342bebe4256c69be24431/sublime_harness-0.4.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "1c5d533b9457623fa9a6685c1d8387dd", "sha256": "6bab64e141502dca12a3392b8bdbda67c025eb95424aa4be4a2d18a09a5afcf8" }, "downloads": -1, "filename": "sublime_harness-0.4.2.zip", "has_sig": false, "md5_digest": "1c5d533b9457623fa9a6685c1d8387dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17486, "upload_time": "2015-12-30T03:39:18", "url": "https://files.pythonhosted.org/packages/69/c0/0ba7dcaa4d248f6fd0c0f3ad5d78e26c0c09e8733d9816344a4e7e9d6c49/sublime_harness-0.4.2.zip" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "2185fca774bcca20aecfd984eea3250d", "sha256": "11c9a8e7607269d6e4c5048d775ed64f2d1f6903206f8dc1b7b3e378b4f654e9" }, "downloads": -1, "filename": "sublime_harness-1.0.0.tar.gz", "has_sig": false, "md5_digest": "2185fca774bcca20aecfd984eea3250d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8921, "upload_time": "2015-12-30T03:41:12", "url": "https://files.pythonhosted.org/packages/5c/1d/8ce861fe5d3558e51667082df69f5f789b02186c7493a7fb6142c33af479/sublime_harness-1.0.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "ae241f0a050f4570445b0e86a03c9b3a", "sha256": "9c6ae394755e8677f7062cfe7e19b137a7e6560f017d26f1918e4d74451e9807" }, "downloads": -1, "filename": "sublime_harness-1.0.0.zip", "has_sig": false, "md5_digest": "ae241f0a050f4570445b0e86a03c9b3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17834, "upload_time": "2015-12-30T03:41:17", "url": "https://files.pythonhosted.org/packages/99/98/d811c5f6acc66c7135a538784c527729cb2970403882ff4d6d268466003f/sublime_harness-1.0.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2185fca774bcca20aecfd984eea3250d", "sha256": "11c9a8e7607269d6e4c5048d775ed64f2d1f6903206f8dc1b7b3e378b4f654e9" }, "downloads": -1, "filename": "sublime_harness-1.0.0.tar.gz", "has_sig": false, "md5_digest": "2185fca774bcca20aecfd984eea3250d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8921, "upload_time": "2015-12-30T03:41:12", "url": "https://files.pythonhosted.org/packages/5c/1d/8ce861fe5d3558e51667082df69f5f789b02186c7493a7fb6142c33af479/sublime_harness-1.0.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "ae241f0a050f4570445b0e86a03c9b3a", "sha256": "9c6ae394755e8677f7062cfe7e19b137a7e6560f017d26f1918e4d74451e9807" }, "downloads": -1, "filename": "sublime_harness-1.0.0.zip", "has_sig": false, "md5_digest": "ae241f0a050f4570445b0e86a03c9b3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17834, "upload_time": "2015-12-30T03:41:17", "url": "https://files.pythonhosted.org/packages/99/98/d811c5f6acc66c7135a538784c527729cb2970403882ff4d6d268466003f/sublime_harness-1.0.0.zip" } ] }