Goal: Be able to hotswap between servers (e.g. for different courses or for different assignments in the same course) without having to delete the current server directory and redownload all the student papers, etc.
Use case: When running multiple courses that use plom it might be helpful to be able to switch between different servers to look at how the marking process is going in each one. Or, sometimes when marking multiple sections of the same course it can be convenient to be able to switch quickly between sections (e.g., "I know somebody in the first section made this same mistake but I can't quite remember what I thought was wrong with it, let me go check what they said")
Store servers for each class/assignment combo in different local directories. Whenever the user wants to switch (course, assignment), check if a directory for that exists already. If so, then try and launch a server from that directory. Else, make the directory and initialize all the data, etc.
Whenever user wants to switch to a different (course, assignment), give the option to either kill the current server and start a new one in the new directory, or keep the old server alive and choose a different port for the new server and launch the new server.
CanvasServerStateso that we can do something like
assignmentinstead of using a hardcoded path (already implemented a few days ago)
LiveServersthat holds a list of all currently-running
LiveServersand have its information (e.g. directory, port number, etc.) written to some file so that it's easy to later show the user something like "here are some servers you used in the past, do you want to start them back up?"
from plom.server import PlomServerto make this possible welcome
PlomServer.server._server_proc.terminate()it doesn't seem to do it???
popen2and some builtin python thing: latter not reliable yet