@GilShoshan94 this is awesome. I really wanted a log viewer, or rather, a console. I am old DOS kind of guy.
I have been playing with some js terminal options, first TerminalJS (not worth it) and then ptty, which are both easy to implement. I was not worried about getting the commands to trigger a python function, but at least to output something so I can know where things are.
I’ve taken your post as a reference, as I am not a specialist in panel. Although I made a different approach.
-
I started by implementing a TerminalPlot.py (mimicking PlotlyPlot.py) to be able to load the JS from the pn.extension(‘terminal’) command. This works very well as ptty has only two JS files to load.
-
Then, instead of using the two pane.HTML as you did, I subclassed DivPanelBase. I wanted this new class to be the only class, but the only parameter that I could store a string and trigger a jslink/jscallback is .object. I tried creating new parameters, but Bokeh seems to have a predefined list which I did not manage to go around. So I subclasses CompositeWidget and add the new class and a pane.HTML one, like you did.
-
I used a jslink instead of writing the script into the object directly. Ihad many skiped number and even time.sleep was not helping
Now it seems to work, (repeated object value or not), but I don’t know enough panel or JS (at all) to make it better coded.
I can share the filees if you want, although they are a bit of a mess.