An universal wrapper (and useful tool) to make event / commands in python
Project description
easy-events
Installation
pip install easy-events
Code example
from commands import Commands
# create an event or use it in a class
client = Commands()
# create an event
@client.event("event_name")
def test1():
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 Distribution
easy-events-1.1.0.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for easy_events-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8599f82ea89e5ca2e2a3f7669ef79f7203c818d27e99e53d776da1662577bf12 |
|
MD5 | d9ca7fc4786bb900dc55cdbcc872771e |
|
BLAKE2b-256 | 35a83db36e2be378917e1d76f074b62830a6ac352379c989ea2f296a20bf4c55 |