Ensure console commands are executed in order
This commit is contained in:
parent
f077030dfc
commit
88dd64e795
|
@ -113,16 +113,16 @@ class Commander:
|
||||||
def on_connect(result):
|
def on_connect(result):
|
||||||
def on_started(result):
|
def on_started(result):
|
||||||
def on_started(result):
|
def on_started(result):
|
||||||
deferreds = []
|
def do_command(result, cmd):
|
||||||
|
return self.do_command(cmd)
|
||||||
|
|
||||||
|
d = defer.succeed(None)
|
||||||
# If we have args, lets process them and quit
|
# If we have args, lets process them and quit
|
||||||
# allow multiple commands split by ";"
|
# allow multiple commands split by ";"
|
||||||
for arg in args.split(";"):
|
for arg in args.split(";"):
|
||||||
deferreds.append(defer.maybeDeferred(self.do_command, arg.strip()))
|
d.addCallback(do_command, arg.strip())
|
||||||
|
|
||||||
def on_complete(result):
|
d.addCallback(do_command, "quit")
|
||||||
self.do_command("quit")
|
|
||||||
|
|
||||||
dl = defer.DeferredList(deferreds).addCallback(on_complete)
|
|
||||||
|
|
||||||
# We need to wait for the rpcs in start() to finish before processing
|
# We need to wait for the rpcs in start() to finish before processing
|
||||||
# any of the commands.
|
# any of the commands.
|
||||||
|
|
Loading…
Reference in New Issue