An universal wrapper (and useful tool) to make event / commands in python
Reason this release was yanked:
Important bug with args
Project description
easy-events
A library that help you to manage events
Getting started
Installation
pip install easy-events
GitHub : Github
Usages
text
Code example
from easy_events import Events
# create an event or use it in a class
client = Events()
# create an event
@client.event("event_name")
def test1(data):
do_action_here
# trigger the event
client.trigger("event_name")
# create another event
# you can put as much parameters as you want
@client.event("second_event")
def test1(data, arg1, arg2, *, arg3):
# data is the default parameter, it contain some basic informations that you can format as you want
do_action_here
# trigger the event
client.trigger({"event": "second_event", "parameters": ["arg1", "arg2", "arg3", "arg4"]})
# here the parameters will be :
# arg1 = arg1
# arg2 = arg2
# arg3 = [arg3, arg4]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
easy-events-2.0.0.tar.gz
(6.2 kB
view hashes)
Built Distribution
Close
Hashes for easy_events-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d85ae2965dcf7ee1c19e2b810b955a70e2a04a7c6971bb09d9a146e8a6ae5360 |
|
MD5 | a0d349d3027976f0cdab8f4a46282501 |
|
BLAKE2b-256 | d35ad6b03e2afd433d74282beec1931cf2e54ceb8c700e03408c292ad83b4e5f |