mirror of
https://github.com/bisq-network/bisq-api-reference.git
synced 2026-01-31 18:23:36 +00:00
- Use requirements.txt to install dependencies to local venv. - Use setup.py to build/install example packages to local venv. - Adjust reference-doc-builder to new Python pkg imports.
23 lines
634 B
Python
23 lines
634 B
Python
# From https://expobrain.net/2010/07/31/simple-event-dispatcher-in-python
|
|
from trade_event import TradeEvent
|
|
from trade_event_data import TradeEventData
|
|
|
|
|
|
class TradeEventSender(object):
|
|
"""
|
|
First class which ask who is listening to it
|
|
"""
|
|
|
|
def __init__(self, event_dispatcher):
|
|
# Save a reference to the event dispatch
|
|
self.event_dispatcher = event_dispatcher
|
|
|
|
def main(self):
|
|
"""
|
|
Send a TradeEvent
|
|
"""
|
|
|
|
self.event_dispatcher.dispatch_event(
|
|
TradeEvent(TradeEvent.MUST_SEND_PAYMENT_STARTED_MSG_EVENT, TradeEventData('trade', 'what to do...'))
|
|
)
|