pyeventlib


Namepyeventlib JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/DuelitDev/pyeventlib
SummaryUse event handler simply.
upload_time2023-02-11 19:48:56
maintainerDuelitDev
docs_urlNone
authorDuelitDev
requires_python>=3.7
license
keywords event eventhandler pyevent pyevents pyeventlib
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyeventlib
pyeventlib library is used to handle event in a simple way.  
## Install
`pip install pyeventlib`  
## Examples
```python
import asyncio
from pyeventlib import *


class CloseEventArgs(EventArgs):
    def __init__(self):
        self.accept = False
# other option
# CloseEventArgs = EventArgs.create(
#     "CloseEventArgs", 
#     {"accept": False})


event1 = EventHandler()
event2 = EventHandler()


async def main():
    await event1(__name__)
    args = CloseEventArgs()
    await event2(__name__, args)
    print(args.accept)  # True
    

@event1.register
def event_a(sender):
    print("Event A Sender: " + sender)


async def event_b(sender):
    print("Event C Sender: " + sender)
event1 += event_b


@event2.register
def close_event(sender, e):
    e.accept = True


asyncio.run(main())
```   
## Copyright
Copyright 2023. DuelitDev all rights reserved.  
## License
[MIT License](https://github.com/DuelitDev/pyeventlib/blob/main/LICENSE) 

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DuelitDev/pyeventlib",
    "name": "pyeventlib",
    "maintainer": "DuelitDev",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "jyoon07dev@gmail.com",
    "keywords": "event,eventhandler,pyevent,pyevents,pyeventlib",
    "author": "DuelitDev",
    "author_email": "jyoon07dev@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "# pyeventlib\npyeventlib library is used to handle event in a simple way.  \n## Install\n`pip install pyeventlib`  \n## Examples\n```python\nimport asyncio\nfrom pyeventlib import *\n\n\nclass CloseEventArgs(EventArgs):\n    def __init__(self):\n        self.accept = False\n# other option\n# CloseEventArgs = EventArgs.create(\n#     \"CloseEventArgs\", \n#     {\"accept\": False})\n\n\nevent1 = EventHandler()\nevent2 = EventHandler()\n\n\nasync def main():\n    await event1(__name__)\n    args = CloseEventArgs()\n    await event2(__name__, args)\n    print(args.accept)  # True\n    \n\n@event1.register\ndef event_a(sender):\n    print(\"Event A Sender: \" + sender)\n\n\nasync def event_b(sender):\n    print(\"Event C Sender: \" + sender)\nevent1 += event_b\n\n\n@event2.register\ndef close_event(sender, e):\n    e.accept = True\n\n\nasyncio.run(main())\n```   \n## Copyright\nCopyright 2023. DuelitDev all rights reserved.  \n## License\n[MIT License](https://github.com/DuelitDev/pyeventlib/blob/main/LICENSE) \n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Use event handler simply.",
    "version": "1.1.1",
    "split_keywords": [
        "event",
        "eventhandler",
        "pyevent",
        "pyevents",
        "pyeventlib"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "194d4a8e4374b9e358f8832aa011a28451b6659ef4fe4c16dc7d23e2683e1bf0",
                "md5": "a14354b4b7996d49e304c92bdb31ddba",
                "sha256": "a30e37a52de0bc6a5ac9d9997bd3ed66775bb9cb87dbfa80d900216fd96270a6"
            },
            "downloads": -1,
            "filename": "pyeventlib-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a14354b4b7996d49e304c92bdb31ddba",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 4239,
            "upload_time": "2023-02-11T19:48:56",
            "upload_time_iso_8601": "2023-02-11T19:48:56.466865Z",
            "url": "https://files.pythonhosted.org/packages/19/4d/4a8e4374b9e358f8832aa011a28451b6659ef4fe4c16dc7d23e2683e1bf0/pyeventlib-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-11 19:48:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "DuelitDev",
    "github_project": "pyeventlib",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "pyeventlib"
}
        
Elapsed time: 0.77354s