Revision 9f33ef86 lib/cli.py
b/lib/cli.py | ||
---|---|---|
336 | 336 |
return answer |
337 | 337 |
|
338 | 338 |
|
339 |
def SubmitOpCode(op): |
|
339 |
def SubmitOpCode(op, proc=None, feedback_fn=None):
|
|
340 | 340 |
"""Function to submit an opcode. |
341 | 341 |
|
342 | 342 |
This is just a simple wrapper over the construction of the processor |
... | ... | |
344 | 344 |
interaction functions. |
345 | 345 |
|
346 | 346 |
""" |
347 |
proc = mcpu.Processor() |
|
348 |
return proc.ExecOpCode(op, logger.ToStdout) |
|
347 |
if proc is None: |
|
348 |
proc = mcpu.Processor() |
|
349 |
if feedback_fn is None: |
|
350 |
feedback_fn = logger.ToStdout |
|
351 |
return proc.ExecOpCode(op, feedback_fn) |
|
349 | 352 |
|
350 | 353 |
|
351 | 354 |
def GenericMain(commands, override=None): |
Also available in: Unified diff