In [ ]:
import os,sys
sys.path.insert(0, os.path.abspath('..'))
import ipywidgets as w
from hublib.ui import RunCommand
In [ ]:
def my_start(s):
rname = s.make_rname(cmd.value)
s.run(cmd.value, rname)
In [ ]:
# after the run finished, optionally do something
# with the output
def read_data(s, rdir):
# any files written will be in rdir
# we could use those to plot or something...
pass
In [ ]:
cmd = w.Text(
placeholder='Command to execute',
description='Command:'
)
cmd
In [ ]:
rc = RunCommand(start_func=my_start, done_func=read_data, cachename='Runtest', cachedir='/opt/tmp')
In [ ]:
display(rc)