The pyshell is only really used as a debug or other extension tool by experts. Every time I use it the first thing I do is import the depot to grab a device or similar. I suggest we automate the import of depot, possibly some other modules, or maybe a configurable set.
The default behavior is to run the users PYTHONSTARTUP, but I mostly don't wont to import the cockpit depot for other python processes so I think using this is a non-starter. I did a quick hack to add
window.shell.run('from cockpit import depot')
in the shellwindow.makeWindow function, which is equivalent to typing the text in the shell.
Maybe we could add a config option to execute a list of commands at shell startup?
The pyshell is only really used as a debug or other extension tool by experts. Every time I use it the first thing I do is import the depot to grab a device or similar. I suggest we automate the import of depot, possibly some other modules, or maybe a configurable set.
The default behavior is to run the users PYTHONSTARTUP, but I mostly don't wont to import the cockpit depot for other python processes so I think using this is a non-starter. I did a quick hack to add
in the shellwindow.makeWindow function, which is equivalent to typing the text in the shell.
Maybe we could add a config option to execute a list of commands at shell startup?