Revision e2212007 lib/cli.py
b/lib/cli.py | ||
---|---|---|
369 | 369 |
return answer |
370 | 370 |
|
371 | 371 |
|
372 |
def SubmitOpCode(op, proc=None, feedback_fn=None):
|
|
372 |
def SubmitOpCode(op, cl=None, feedback_fn=None):
|
|
373 | 373 |
"""Legacy function to submit an opcode. |
374 | 374 |
|
375 | 375 |
This is just a simple wrapper over the construction of the processor |
... | ... | |
377 | 377 |
interaction functions. |
378 | 378 |
|
379 | 379 |
""" |
380 |
# TODO: Fix feedback_fn situation.
|
|
381 |
cl = luxi.Client() |
|
380 |
if cl is None:
|
|
381 |
cl = luxi.Client()
|
|
382 | 382 |
|
383 | 383 |
job_id = cl.SubmitJob([op]) |
384 | 384 |
|
... | ... | |
395 | 395 |
break |
396 | 396 |
msg = jobs[0][1] |
397 | 397 |
if msg is not None and msg != lastmsg: |
398 |
print "%s %s" % (time.ctime(msg[0]), msg[2]) |
|
398 |
if callable(feedback_fn): |
|
399 |
feedback_fn(msg) |
|
400 |
else: |
|
401 |
print "%s %s" % (time.ctime(msg[0]), msg[2]) |
|
399 | 402 |
lastmsg = msg |
400 | 403 |
time.sleep(1) |
401 | 404 |
|
Also available in: Unified diff