{ "info": { "author": "Corentin CAM", "author_email": "cam.corentin@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "# yaphs\n\n[![pipeline status](https://gitlab.com/valtrok/yaphs/badges/master/pipeline.svg)](https://gitlab.com/valtrok/yaphs/pipelines)\n[![coverage report](https://gitlab.com/valtrok/yaphs/badges/master/coverage.svg)](https://valtrok.gitlab.io/yaphs/)\n\nYet another python hook system for python 2.7/3.x\n\n# Usage\n\n## Basic usage\n\nImport yaphs\n```python\nfrom yaphs import Hook\n```\n\nRegister foo as a hook-compatible function\n```python\n@Hook\ndef foo(*args):\n print(args)\n```\n\nRegister bar as a hook to be executed before calling foo\n```python\n@foo.before(*args):\ndef bar(*args):\n print('before foo, args: ' + str(args))\n```\n\nWhen you call foo, bar is called before\n```python\nfoo(1, 2)\n```\n\nExpected output:\n```\nbefore foo, args: (1, 2)\n(1, 2)\n```\n\n## Class usage (python 3.x only)\n\nYou can use yaphs hooks inside classes:\n```python\nclass MyClass:\n @Hook\n def foo(self, *args)\n```\n\nWhen you register hooks, you just have to know that the first argument will be the object\n```python\nc = MyClass()\n\n@c.foo.after:\ndef bar(o, *args):\n print('after foo')\n print('object: ' + str(o))\n print('args: ' + str(args))\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/valtrok/yaphs", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "yaphs", "package_url": "https://pypi.org/project/yaphs/", "platform": "", "project_url": "https://pypi.org/project/yaphs/", "project_urls": { "Homepage": "https://gitlab.com/valtrok/yaphs", "Source Code": "https://gitlab.com/valtrok/yaphs" }, "release_url": "https://pypi.org/project/yaphs/1.0/", "requires_dist": null, "requires_python": "", "summary": "Yet another python hook system", "version": "1.0" }, "last_serial": 5472730, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "5c5cb56a2b28c75c4a2f68da0a6948af", "sha256": "368ade1feb256958f6dd74847f54e3944f84d53c31bee7bb1aab3ac165f40fc0" }, "downloads": -1, "filename": "yaphs-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5c5cb56a2b28c75c4a2f68da0a6948af", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2822, "upload_time": "2019-07-01T18:31:12", "url": "https://files.pythonhosted.org/packages/af/00/618b20d259ba81b597db8118c8df6a27b1b2e504e814cb769d7aa237a0bd/yaphs-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "11792a262353bc7baa4cfff57376f982", "sha256": "75dd3d48e700f810d7c466e8159fb7673d349f7bb1dec475d722897bc0667f8a" }, "downloads": -1, "filename": "yaphs-1.0.tar.gz", "has_sig": false, "md5_digest": "11792a262353bc7baa4cfff57376f982", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1862, "upload_time": "2019-07-01T18:31:14", "url": "https://files.pythonhosted.org/packages/1d/d0/f9fe10d2258c8489bfa8d2e63194d2c5b7603e3e53e68a12d281f8f357bb/yaphs-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5c5cb56a2b28c75c4a2f68da0a6948af", "sha256": "368ade1feb256958f6dd74847f54e3944f84d53c31bee7bb1aab3ac165f40fc0" }, "downloads": -1, "filename": "yaphs-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5c5cb56a2b28c75c4a2f68da0a6948af", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2822, "upload_time": "2019-07-01T18:31:12", "url": "https://files.pythonhosted.org/packages/af/00/618b20d259ba81b597db8118c8df6a27b1b2e504e814cb769d7aa237a0bd/yaphs-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "11792a262353bc7baa4cfff57376f982", "sha256": "75dd3d48e700f810d7c466e8159fb7673d349f7bb1dec475d722897bc0667f8a" }, "downloads": -1, "filename": "yaphs-1.0.tar.gz", "has_sig": false, "md5_digest": "11792a262353bc7baa4cfff57376f982", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1862, "upload_time": "2019-07-01T18:31:14", "url": "https://files.pythonhosted.org/packages/1d/d0/f9fe10d2258c8489bfa8d2e63194d2c5b7603e3e53e68a12d281f8f357bb/yaphs-1.0.tar.gz" } ] }