|
seq
3.0.0
|
Asynchronous wrapper around the subprocess seq kernel.
More...
Public Member Functions | |
| def | __init__ (self, loop, redis_address, log_level, evt, use_stdout=True, use_redis=False) |
| def | proc_reader (self) |
| def | write_cmd (self, text) |
| Write command to PIPE stdin. More... | |
| def | start_seq_core (self) |
| def | emptyline (self) |
| empty line handle More... | |
| def | do_clear (self, arg) |
| def | do_quit (self, line) |
| def | do_init (self, line="") |
| def | do_err (self, line) |
| def | do_load (self, line) |
| def | do_modules (self, line) |
| def | tpl_done_cb (self, task) |
| a simple callback for pending command (unused) More... | |
| def | do_run (self, arg) |
| Executes all loaded modules. More... | |
| def | do_nodes (self, arg) |
| nodes command More... | |
| def | do_save (self, arg) |
| save command More... | |
| def | do_session (self, arg) |
| session command More... | |
| def | do_tree (self, arg) |
| def | do_skip (self, arg) |
| skip command More... | |
| def | do_unskip (self, arg) |
| unskip command More... | |
| def | do_pause (self, arg) |
| pause command More... | |
| def | do_flip (self, arg) |
| flip command More... | |
| def | do_resume (self, arg) |
| resume command More... | |
| def | do_break (self, arg) |
| break command More... | |
| def | do_abort (self, arg) |
| def | do_ob (self, arg) |
| def | do_retry (self, arg) |
| def | do_continue (self, arg) |
| def | do_lsob (self, arg) |
| def | do_lsvar (self, arg) |
| def | do_setvar (self, arg) |
| def | do_checked (self, arg) |
| def | do_bp (self, arg) |
| bypass to subprocess command More... | |
Public Member Functions inherited from cli.seq_cmdasync.AsyncCmd | |
| def | __init__ (self, loop, completekey='tab', stdin=None, stdout=None) |
| def | cb (self, f, arg, future) |
| def | exc_handler (self, exc) |
| def | onecmd (self, line) |
| Interpret the argument as though it had been typed in response to the prompt. More... | |
Public Attributes | |
| proc | |
| reader_task | |
| quit_event | |
| redis | |
| use_redis | |
| use_stdout | |
| redis_port | |
| session | |
| s_json | |
Public Attributes inherited from cli.seq_cmdasync.AsyncCmd | |
| use_rawinput | |
| loop | |
| repl_future | |
| lastcmd | |
Static Public Attributes | |
| bool | use_rawinput = False |
| current_task = None | |
| modules_json = None | |
| log_level = logging.INFO | |
| ob = None | |
| dictionary | s_json = {} |
| dictionary | tree = {} |
| string | prompt = "(seq)>> " |
| list | keywords |
Asynchronous wrapper around the subprocess seq kernel.
This class starts a subprocess seq kernel and writes commands to it through its stdin channel, and monitor its responses in the stdout channel.
Using the responses in stdout, it publishes to redis feedback on the sequencer commands and the progress of the sequence execution.
| def cli.seqsh.SeqShell.__init__ | ( | self, | |
| loop, | |||
| redis_address, | |||
| log_level, | |||
| evt, | |||
use_stdout = True, |
|||
use_redis = False |
|||
| ) |
| def cli.seqsh.SeqShell.do_abort | ( | self, | |
| arg | |||
| ) |
| def cli.seqsh.SeqShell.do_bp | ( | self, | |
| arg | |||
| ) |
bypass to subprocess command
| def cli.seqsh.SeqShell.do_break | ( | self, | |
| arg | |||
| ) |
break command
| def cli.seqsh.SeqShell.do_checked | ( | self, | |
| arg | |||
| ) |
| def cli.seqsh.SeqShell.do_clear | ( | self, | |
| arg | |||
| ) |
Kills suboprocess
| def cli.seqsh.SeqShell.do_continue | ( | self, | |
| arg | |||
| ) |
continue command
| def cli.seqsh.SeqShell.do_err | ( | self, | |
| line | |||
| ) |
err command
| def cli.seqsh.SeqShell.do_flip | ( | self, | |
| arg | |||
| ) |
flip command
| def cli.seqsh.SeqShell.do_init | ( | self, | |
line = "" |
|||
| ) |
init command Connect to server(s) (Seq and redis) Creates sequencer exec process
| def cli.seqsh.SeqShell.do_load | ( | self, | |
| line | |||
| ) |
load command
| def cli.seqsh.SeqShell.do_lsob | ( | self, | |
| arg | |||
| ) |
lsob command
| def cli.seqsh.SeqShell.do_lsvar | ( | self, | |
| arg | |||
| ) |
lsvar command
| def cli.seqsh.SeqShell.do_modules | ( | self, | |
| line | |||
| ) |
modules command
| def cli.seqsh.SeqShell.do_nodes | ( | self, | |
| arg | |||
| ) |
nodes command
| def cli.seqsh.SeqShell.do_ob | ( | self, | |
| arg | |||
| ) |
Loads an OB file (json)
| def cli.seqsh.SeqShell.do_pause | ( | self, | |
| arg | |||
| ) |
pause command
| def cli.seqsh.SeqShell.do_quit | ( | self, | |
| line | |||
| ) |
quit command
| def cli.seqsh.SeqShell.do_resume | ( | self, | |
| arg | |||
| ) |
resume command
| def cli.seqsh.SeqShell.do_retry | ( | self, | |
| arg | |||
| ) |
retry command
| def cli.seqsh.SeqShell.do_run | ( | self, | |
| arg | |||
| ) |
Executes all loaded modules.
| def cli.seqsh.SeqShell.do_save | ( | self, | |
| arg | |||
| ) |
save command
| def cli.seqsh.SeqShell.do_session | ( | self, | |
| arg | |||
| ) |
session command
| def cli.seqsh.SeqShell.do_setvar | ( | self, | |
| arg | |||
| ) |
setvar 0 {"0": [{"name": "par_a", "type": "n/a", "value": "sds"}, {"name": "par_b", "type": "integer", "value": "22"}, {"name": "par_c", "type": "number", "value": "33"}],
"1": [{"name": "par_x", "type": "n/a", "value": "string"}, {"name": "par_y", "type": "integer", "value": 0}, {"name": "par_z", "type": "number", "value": 0}]}
return b'{"0": {"0": {"par_a": {"name": "par_a", "value": "pippo"}, "par_b": {"name": "par_b", "type": "integer", "value": 22}, "par_c": {"name": "par_c", "type": "number", "value": 44}}, "1": {"par_x": {"name": "par_x", "value": "sting"}, "par_y": {"name": "par_y", "type": "integer", "value": 66}, "par_z": {"name": "par_z", "type": "number", "value": 77}}}}'
{"0": {"par_a": {"name": "par_a", "value": "pippo"}, "par_b": {"name": "par_b", "type": "integer", "value": 22}, "par_c": {"name": "par_c", "type": "number", "value": 44}}, "1": {"par_x": {"name": "par_x", "value": "sting"}, "par_y": {"name": "par_y", "type": "integer", "value": 66}, "par_z": {"name": "par_z", "type": "number", "value": 77}}}
| def cli.seqsh.SeqShell.do_skip | ( | self, | |
| arg | |||
| ) |
skip command
| def cli.seqsh.SeqShell.do_tree | ( | self, | |
| arg | |||
| ) |
tree command
| def cli.seqsh.SeqShell.do_unskip | ( | self, | |
| arg | |||
| ) |
unskip command
| def cli.seqsh.SeqShell.emptyline | ( | self | ) |
empty line handle
| def cli.seqsh.SeqShell.proc_reader | ( | self | ) |
Loop method. It monitors the lines from the `seq kernel` subprocess
stdout, and finds json formats.
Once a '{' character is found, it is assumed to be the start of a json
string. It is loaded as json.
Responses from the `seq kernel` include json formatted string which are
transformed into dictionaries.
From those, a set of keywords (seq.cli.keywords) are use to find
information of interest to be published to redis.
- State change (SEQ_STATE_CHANGE)
- Tree update (SEQ_TREE)
- OB update (SEQ_OB)
- Vars update (SEQ_TPL_VARS)
- Error (SEQ_ERROR)
| def cli.seqsh.SeqShell.start_seq_core | ( | self | ) |
Starts sequencer interpreter process
| def cli.seqsh.SeqShell.tpl_done_cb | ( | self, | |
| task | |||
| ) |
a simple callback for pending command (unused)
| def cli.seqsh.SeqShell.write_cmd | ( | self, | |
| text | |||
| ) |
Write command to PIPE stdin.
|
static |
|
static |
|
static |
|
static |
|
static |
| cli.seqsh.SeqShell.proc |
|
static |
| cli.seqsh.SeqShell.quit_event |
| cli.seqsh.SeqShell.reader_task |
| cli.seqsh.SeqShell.redis |
| cli.seqsh.SeqShell.redis_port |
|
static |
| cli.seqsh.SeqShell.s_json |
| cli.seqsh.SeqShell.session |
|
static |
|
static |
| cli.seqsh.SeqShell.use_redis |
| cli.seqsh.SeqShell.use_stdout |