mirror of
https://github.com/bisq-network/bisq-api-reference.git
synced 2026-01-27 17:43:33 +00:00
This might give Python devs an easier time than if all the sample code lived deep inside a gradle project. This means there is no root project gradle build file; the reference-doc-builder and java-examples modules are separate java projects, with their own build files.
27 lines
612 B
Python
27 lines
612 B
Python
# From https://expobrain.net/2010/07/31/simple-event-dispatcher-in-python
|
|
class Event(object):
|
|
"""
|
|
Generic event to use with EventDispatcher.
|
|
"""
|
|
|
|
def __init__(self, event_type, data=None):
|
|
"""
|
|
The constructor accepts an event type as string and a custom data
|
|
"""
|
|
self._type = event_type
|
|
self._data = data
|
|
|
|
@property
|
|
def type(self):
|
|
"""
|
|
Returns the event type
|
|
"""
|
|
return self._type
|
|
|
|
@property
|
|
def data(self):
|
|
"""
|
|
Returns the data associated to the event
|
|
"""
|
|
return self._data
|