An universal wrapper (and useful tool) to make event / commands in python
Project description
easy-events
Installation
pip install easy-events
Code example
from easy_events import Commands
# create an event or use it in a class
client = Commands()
# create an event
@client.event("event_name")
def test1(data):
do_action_here
# trigger the event
client.process_data("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.process_data({"command": "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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for easy_events-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 361b22cd5b0bf5fa9b5c0711eefb60cf2d9637caffb4acf37559d2b6ba4a27d4 |
|
MD5 | a285ce15e4861fe61c8c86ec826b4454 |
|
BLAKE2b-256 | f860e8b423d83dd45a3204a89debc366b43f5ca06faead83c7eb7d7a2d46a07c |