Port trades command to async

This commit is contained in:
Mark Veidemanis 2022-05-03 08:48:58 +01:00
parent d3b4d3ea21
commit f8521eced3
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 9 additions and 6 deletions

View File

@ -7,6 +7,14 @@ from settings import settings
class GenericCommands(object):
class trades(object):
@staticmethod
def got_trades(trades, msg):
if not trades:
msg("No open trades.")
return
for trade_id in trades:
msg(trade_id)
@staticmethod
def run(cmd, spl, length, authed, msg, agora, tx, ux, caller):
"""
@ -14,12 +22,7 @@ class GenericCommands(object):
"""
trades = caller.get_dashboard_irc()
if not trades:
msg("No open trades.")
return
for trade_id in trades:
msg(trade_id)
trades.addCallback(GenericCommands.trades.got_trades, msg)
class create(object):
@staticmethod