{ "info": { "author": "Deisss", "author_email": "deisss@free.fr", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Topic :: Communications" ], "description": "python-sockjsroom\n=================\n\nAdd multi-room and multi-message type support for sockjs-tornado.\n\n\nInstallation\n------------\n\nThe most easy way to install sockjsroom is to use Pypi:\n```\npip install sockjsroom\n```\nIt will also auto-include tornado and sockjs-tornado\n\nThe alternative method is to clone this repository:\n```\ngit clone https://github.com/Deisss/python-sockjsroom.git\n```\nAnd run setup:\n```\npython setup.py install\n```\n\n\n\nUsage\n-----\n\nThe most basic usage can be a Ping system:\n\n```python\nfrom sockjsroom import SockJSDefaultHandler\n\n\nclass PingSocketHandler(SockJSDefaultHandler):\n \"\"\" Ping system \"\"\"\n def on_open(self, info):\n pass\n\n def on_message(self):\n pass\n\n def on_close(self):\n pass\n```\n\nThis example does only create an empty handler, without any room support.\n\nHere a more complete example using room support:\n\n```python\nfrom sockjsroom import SockJSRoomHandler\n\nclass MySocketHandler(SockJSRoomHandler):\n def initialize(self):\n self.roomId = \"0\"\n\n # SOCKJS DEFAULT FUNCTION\n\n def on_open(self, info):\n pass\n\n def on_close(self):\n self.on_leave()\n\n # SOCKJS CUSTOM FUNCTION\n\n def on_join(self, data):\n \"\"\" Join timer system \"\"\"\n # data => roomId\n self.initialize()\n\n self.roomId = str(data.roomId)\n\n def on_chat(self, data):\n \"\"\" Start timer for everybody \"\"\"\n # data => message\n self.publishToRoom(self.roomId, \"chat\", {\"message\" : data.message})\n\n def on_leave(self):\n \"\"\" Quit timer system \"\"\"\n if self.roomId != \"0\":\n self.leave(self.roomId)\n\n self.initialize()\n```\nNow you can have not only **on_open**, **on_message** and **on_close**, \nbut almost what you want (except on_message already used internally).\n\nThe system will do the json convertion for you directly, and helps you\nthrew publishing process by providing:\n\n * **publishToRoom** send message to everybody\n * **publishToMyself** send message to yourself\n * **publishToOther** send message to everybody else\n\nWith those, it may become simple to publish data to subset of people with ease.\n\n\n\nFurthermore\n-----------\n\nYou can found an exaustive presentation of code, and possibilities [here](http://simplapi.wordpress.com/2013/09/22/sockjs-on-steroids/)", "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/Deisss/python-sockjsroom", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "sockjsroom", "package_url": "https://pypi.org/project/sockjsroom/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/sockjsroom/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Deisss/python-sockjsroom" }, "release_url": "https://pypi.org/project/sockjsroom/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Sockjs-tornado multi room system", "version": "0.0.3" }, "last_serial": 900166, "releases": { "0.0.1": [], "0.0.2": [ { "comment_text": "", "digests": { "md5": "684203a1f7f7b466f3105f454fedcd26", "sha256": "9bf96b36f712706910b9a1d1453ed0fe63a47bc5b38cb15320acec0ee3d31bde" }, "downloads": -1, "filename": "sockjsroom-0.0.2.zip", "has_sig": false, "md5_digest": "684203a1f7f7b466f3105f454fedcd26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9438, "upload_time": "2013-10-17T22:30:44", "url": "https://files.pythonhosted.org/packages/c2/30/4adc953ebc3f126c217538e5a107cfed7323321f22e1ecbfb981447fffb6/sockjsroom-0.0.2.zip" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "163a40628e4ec5365515301c8a0b29cb", "sha256": "d4d663a2aad45a6445365faf05887d274acd02950279e01e0ff9df3a6138a6d9" }, "downloads": -1, "filename": "sockjsroom-0.0.3.zip", "has_sig": false, "md5_digest": "163a40628e4ec5365515301c8a0b29cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9426, "upload_time": "2013-10-21T22:42:19", "url": "https://files.pythonhosted.org/packages/07/70/25600e34406a78324fb5e91287a6c28528274b9172015917c774bf98c654/sockjsroom-0.0.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "163a40628e4ec5365515301c8a0b29cb", "sha256": "d4d663a2aad45a6445365faf05887d274acd02950279e01e0ff9df3a6138a6d9" }, "downloads": -1, "filename": "sockjsroom-0.0.3.zip", "has_sig": false, "md5_digest": "163a40628e4ec5365515301c8a0b29cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9426, "upload_time": "2013-10-21T22:42:19", "url": "https://files.pythonhosted.org/packages/07/70/25600e34406a78324fb5e91287a6c28528274b9172015917c774bf98c654/sockjsroom-0.0.3.zip" } ] }