{ "info": { "author": "Mike Pagel", "author_email": "mike@mpagel.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries" ], "description": "jep-python\r\n==========\r\n\r\n|Build Status| |Coveralls Status| |PyPI Status|\r\n\r\nThis is the Python implementation of the Joint Editors Protocol (JEP),\r\nsee http://joint-editors.org/ for more information. jep-python is providing\r\nlanguage authors with a frontend library for IDE/editor integration and\r\na backend library for language support.\r\n\r\nThis implementation is currently compatible with Python 3.3+.\r\n\r\nLook at these associated projects for examples of productive use of the library:\r\n\r\n* Frontend used in Sublime editor: https://github.com/jep-project/jep-sublime\r\n* Backend used for improved CMake language support: https://github.com/jep-project/jep-cmake\r\n\r\nBackend support\r\n---------------\r\n\r\nImplementing JEP based support for a custom language is easy. Simply\r\nderive one or more listener classes to respond to frontend messages and\r\nthen run the backend with those listeners.\r\n\r\n.. code:: python\r\n\r\n from jep_py.backend import Backend, FrontendListener\r\n\r\n class Listener(FrontendListener):\r\n def on_completion_request(self, completion_request, context):\r\n # process completion request and send back response:\r\n completion_response = f(completion_request)\r\n context.send_message(completion_response)\r\n \r\n # instantiate and start backend service with our listeners:\r\n listener = Listener()\r\n backend = Backend([listener])\r\n backend.start()\r\n\r\nCallbacks that are not needed by a certain listener do not need to be\r\noverridden in the derived class.\r\n\r\nWhile the user is editing a file in a connected IDE the frontend will\r\nrepeatedly send ``ContentSync`` objects to the backend. The backend\r\nimplementation already processes these messages internally and provides\r\nan accumulated file view to client code. Since backend-internal message\r\nprocessing is done *before* messages are passed to subscribed listeners,\r\nyou can process the latest view of a file directly inside your\r\nlistener's handler of ``ContentSync`` by accessing the context's\r\n``content_monitor`` filepath dictionary:\r\n\r\n.. code:: python\r\n\r\n def on_content_sync(self, content_sync, context):\r\n # get the content monitor's view of the file that was just updated:\r\n file_content = context.content_monitor[content_sync.file]\r\n \r\n # ...\r\n\r\nFrontend support\r\n----------------\r\n\r\nSimilarly in an IDE frontend you again derive listener classes, this\r\ntime listening to backend messages. Since the frontend initiates the\r\nconnection you additionally have to create such a connection for a\r\ncertain language. JEP service lookup is then used to determine the\r\nsupporting backend and the frontend will start it in its own subprocess.\r\n\r\nHere is an example shutting down the backend service upon reception of\r\nits first alive message:\r\n\r\n.. code:: python\r\n\r\n import datetime\r\n from jep_py.frontend import Frontend, BackendListener, State\r\n from jep_py.schema import Shutdown\r\n\r\n class MyListener(BackendListener):\r\n def on_backend_alive(self, context):\r\n context.send_message(Shutdown())\r\n\r\n\r\n frontend = Frontend([MyListener()])\r\n connection = frontend.get_connection('localfile.mydsl')\r\n\r\n while connection.state is not State.Disconnected:\r\n connection.run(datetime.timedelta(seconds=0.1))\r\n\r\n.. |Build Status| image:: https://travis-ci.org/jep-project/jep-python.svg?branch=master\r\n :target: https://travis-ci.org/jep-project/jep-python\r\n\r\n.. |PyPI Status| image:: https://badge.fury.io/py/jep-project.svg\r\n :target: https://badge.fury.io/py/jep-project.svg\r\n\r\n.. |Coveralls Status| image:: https://coveralls.io/repos/moltob/jep-python/badge.png?branch=master\r\n :target: https://coveralls.io/r/moltob/jep-python?branch=master", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jep-project/jep-python", "keywords": "jep dsl language editor", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "jep-python", "package_url": "https://pypi.org/project/jep-python/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jep-python/", "project_urls": { "Homepage": "https://github.com/jep-project/jep-python" }, "release_url": "https://pypi.org/project/jep-python/0.5.5/", "requires_dist": null, "requires_python": null, "summary": "Python implementation of the Joint Editors Protocol.", "version": "0.5.5" }, "last_serial": 1889523, "releases": { "0.5.5": [ { "comment_text": "", "digests": { "md5": "b16befe8a14aa6a70e3c554741e2248d", "sha256": "780303d7ce6ea5a5422280976280b24bda8fe4c7e094cefa270fc976cfa82c2e" }, "downloads": -1, "filename": "jep_python-0.5.5-py3-none-any.whl", "has_sig": false, "md5_digest": "b16befe8a14aa6a70e3c554741e2248d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 113093, "upload_time": "2016-01-05T15:01:15", "url": "https://files.pythonhosted.org/packages/1b/f0/084e617ece4d4f4800f302b5ab2b185ba4e8a86e428f0ab8a0276f749822/jep_python-0.5.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5d50ab3b589fa8f6104bfc892cb4995d", "sha256": "a824798d4b9b2ccf1c9491defcca0983af591baaefa7b2dc49bb8ed827ac1b05" }, "downloads": -1, "filename": "jep-python-0.5.5.zip", "has_sig": false, "md5_digest": "5d50ab3b589fa8f6104bfc892cb4995d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36235, "upload_time": "2016-01-05T15:01:39", "url": "https://files.pythonhosted.org/packages/1c/30/ea4790524c0c2427cfca0bc8cd40a05fe8e9bd31863d40a9de9ea58db669/jep-python-0.5.5.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b16befe8a14aa6a70e3c554741e2248d", "sha256": "780303d7ce6ea5a5422280976280b24bda8fe4c7e094cefa270fc976cfa82c2e" }, "downloads": -1, "filename": "jep_python-0.5.5-py3-none-any.whl", "has_sig": false, "md5_digest": "b16befe8a14aa6a70e3c554741e2248d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 113093, "upload_time": "2016-01-05T15:01:15", "url": "https://files.pythonhosted.org/packages/1b/f0/084e617ece4d4f4800f302b5ab2b185ba4e8a86e428f0ab8a0276f749822/jep_python-0.5.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5d50ab3b589fa8f6104bfc892cb4995d", "sha256": "a824798d4b9b2ccf1c9491defcca0983af591baaefa7b2dc49bb8ed827ac1b05" }, "downloads": -1, "filename": "jep-python-0.5.5.zip", "has_sig": false, "md5_digest": "5d50ab3b589fa8f6104bfc892cb4995d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36235, "upload_time": "2016-01-05T15:01:39", "url": "https://files.pythonhosted.org/packages/1c/30/ea4790524c0c2427cfca0bc8cd40a05fe8e9bd31863d40a9de9ea58db669/jep-python-0.5.5.zip" } ] }