seq  4.0.0-pre3
Classes | Functions | Variables
cli.seqsh Namespace Reference

Classes

class  SeqShell
 

Functions

def event_wait (evt, timeout)
 
def shutdown (loop, signal=None)
 exception handler More...
 
def handle_exception (loop, context)
 Cleanup tasks tied to the service's shutdown. More...
 
def write_cmd (self, text)
 Starts sequencer interpreter process. More...
 
def start_seq_core (self)
 empty line handler More...
 
def emptyline (self)
 Kills suboprocess. More...
 
def do_clear (self, arg)
 quit command More...
 
def do_quit (self, line)
 init command More...
 
def do_init (self, line="")
 
def do_err (self, line)
 load command More...
 
def do_load (self, line)
 modules command More...
 
def do_modules (self, line)
 a simple callback for pending command (unused) More...
 
def tpl_done_cb (self, task)
 Executes all loaded modules. More...
 
def do_run (self, arg)
 Executes all loaded modules. More...
 
def do_reset (self, arg)
 nodes command More...
 
def do_nodes (self, arg)
 save command More...
 
def do_save (self, arg)
 session command More...
 
def do_session (self, arg)
 tree command More...
 
def do_tree (self, arg)
 skip command More...
 
def do_skip (self, arg)
 unskip command More...
 
def do_unskip (self, arg)
 pause command More...
 
def do_pause (self, arg)
 flip command More...
 
def do_flip (self, arg)
 resume command More...
 
def do_resume (self, arg)
 break command More...
 
def do_break (self, arg)
 Loads an OB file (json) More...
 
def do_abort (self, arg)
 retry command More...
 
def do_ob (self, arg)
 
def do_retry (self, arg)
 continue command More...
 
def do_continue (self, arg)
 lsob command More...
 
def do_lsob (self, arg)
 lsvar command More...
 
def do_lsvar (self, arg)
 Fetch an OB from OTTO. More...
 
def do_otto (self, arg)
 
def do_fetch (self, arg)
 bypass to subprocess command More...
 
def do_checked (self, arg)
 
def do_continue_seq (self, node_result)
 
def do_bp (self, arg)
 
def mytask (loop, topic_id, log_level, evt, use_stdout=True)
 
def monitor_quit (quit_event)
 seqtool shell main loop More...
 
def main_loop (topic_id, log_level=logging.INFO, use_stdout=True)
 
def shell (topic_id, log_level, use_stdout=True)
 

Variables

 LOGGER = logging.getLogger(__name__)
 
 proc
 
 reader_task
 
 s_json
 

Function Documentation

◆ do_abort()

def cli.seqsh.do_abort (   self,
  arg 
)

retry command

◆ do_bp()

def cli.seqsh.do_bp (   self,
  arg 
)

◆ do_break()

def cli.seqsh.do_break (   self,
  arg 
)

Loads an OB file (json)

   ob <obpath> [--append_flag=<bool> [--otto_flag]]

◆ do_checked()

def cli.seqsh.do_checked (   self,
  arg 
)

◆ do_clear()

def cli.seqsh.do_clear (   self,
  arg 
)

quit command

◆ do_continue()

def cli.seqsh.do_continue (   self,
  arg 
)

lsob command

◆ do_continue_seq()

def cli.seqsh.do_continue_seq (   self,
  node_result 
)

◆ do_err()

def cli.seqsh.do_err (   self,
  line 
)

load command

◆ do_fetch()

def cli.seqsh.do_fetch (   self,
  arg 
)

bypass to subprocess command

◆ do_flip()

def cli.seqsh.do_flip (   self,
  arg 
)

resume command

◆ do_init()

def cli.seqsh.do_init (   self,
  line = "" 
)

◆ do_load()

def cli.seqsh.do_load (   self,
  line 
)

modules command

◆ do_lsob()

def cli.seqsh.do_lsob (   self,
  arg 
)

lsvar command

◆ do_lsvar()

def cli.seqsh.do_lsvar (   self,
  arg 
)

Fetch an OB from OTTO.

◆ do_modules()

def cli.seqsh.do_modules (   self,
  line 
)

a simple callback for pending command (unused)

◆ do_nodes()

def cli.seqsh.do_nodes (   self,
  arg 
)

save command

◆ do_ob()

def cli.seqsh.do_ob (   self,
  arg 
)

◆ do_otto()

def cli.seqsh.do_otto (   self,
  arg 
)

◆ do_pause()

def cli.seqsh.do_pause (   self,
  arg 
)

flip command

◆ do_quit()

def cli.seqsh.do_quit (   self,
  line 
)

init command

   Creates sequencer exec process

◆ do_reset()

def cli.seqsh.do_reset (   self,
  arg 
)

nodes command

◆ do_resume()

def cli.seqsh.do_resume (   self,
  arg 
)

break command

◆ do_retry()

def cli.seqsh.do_retry (   self,
  arg 
)

continue command

◆ do_run()

def cli.seqsh.do_run (   self,
  arg 
)

Executes all loaded modules.

◆ do_save()

def cli.seqsh.do_save (   self,
  arg 
)

session command

◆ do_session()

def cli.seqsh.do_session (   self,
  arg 
)

tree command

◆ do_skip()

def cli.seqsh.do_skip (   self,
  arg 
)

unskip command

◆ do_tree()

def cli.seqsh.do_tree (   self,
  arg 
)

skip command

◆ do_unskip()

def cli.seqsh.do_unskip (   self,
  arg 
)

pause command

◆ emptyline()

def cli.seqsh.emptyline (   self)

Kills suboprocess.

◆ event_wait()

def cli.seqsh.event_wait (   evt,
  timeout 
)

◆ handle_exception()

def cli.seqsh.handle_exception (   loop,
  context 
)

Cleanup tasks tied to the service's shutdown.

Asynchronous wrapper around the subprocess seqtool kernel.

This class starts a subprocess seqtool 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 dds susbcribers feedback on the sequencer commands and the progress of the sequence execution.

Loop method. It monitors the lines from the seqtool 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 seqtool 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 dds subscribers.

  • State change (SEQ_STATE_CHANGE)
  • Tree update (SEQ_TREE)
  • OB update (SEQ_OB)
  • Vars update (SEQ_TPL_VARS)
    - Error (SEQ_ERROR)

◆ main_loop()

def cli.seqsh.main_loop (   topic_id,
  log_level = logging.INFO,
  use_stdout = True 
)

◆ monitor_quit()

def cli.seqsh.monitor_quit (   quit_event)

seqtool shell main loop

Parameters

topic_id int

Sequencer shell function

When executing seqtool shell, seq.cli and click resolves into this function.

It forwards the arguments to a loop function.

Parameters

topic_id int topic identifier to publish changed state event log_level str Minimum log level presented use_stdout bool

◆ mytask()

def cli.seqsh.mytask (   loop,
  topic_id,
  log_level,
  evt,
  use_stdout = True 
)

◆ shell()

def cli.seqsh.shell (   topic_id,
  log_level,
  use_stdout = True 
)

◆ shutdown()

def cli.seqsh.shutdown (   loop,
  signal = None 
)

exception handler

◆ start_seq_core()

def cli.seqsh.start_seq_core (   self)

empty line handler

◆ tpl_done_cb()

def cli.seqsh.tpl_done_cb (   self,
  task 
)

Executes all loaded modules.

◆ write_cmd()

def cli.seqsh.write_cmd (   self,
  text 
)

Starts sequencer interpreter process.

Variable Documentation

◆ LOGGER

cli.seqsh.LOGGER = logging.getLogger(__name__)

◆ proc

cli.seqsh.proc

◆ reader_task

cli.seqsh.reader_task

◆ s_json

cli.seqsh.s_json