basically, the code is just this:
sub.upload_comment(pdf)
I've check that pdf is correct. Maybe I'll try some more in the sandbox instead of dealing with real data
R = sub.upload_comment(pdf)
, the response looks good (` 'upload_status': 'success', etc). I was on canvasapi 2.1.0 (dec 4) upgrader to 2.2.0 (mar 25): same behavour :(
Still dinner-ing will check in a bit
(Family has people over now that we’re all fully vaccinated — woohoo!!)
Me:
fully unrelated: question about webserver things
plom people want to start up a very very lightweight webserver from a docker thing so that people can connect to a plom server from browser
do people generally use like...flask for this still?Friend 1:
my understanding is flask is still the predominant python lightweight webserver
framework
I suppose in theory using python's built-in http is the most "lightweight" but flask is probably very good and much more pleasant
I think I like flask in a way that I do not like pandasFriend 2:
Oh really
I like some pieces of flask but
The main loop is annoying
Like the part where the decorators are modifying this invisible global state in a sense
And then you kick off an eventloop that reads everything and turns it into a server
Does make it hard to compose with other stuffMe:
is there an alternative you'd recommend?
Friend 2:
Nope!
Me:
ah, so like
classic python library situation thenFriend 2:
My bones tell me there should be an elegant asyncio version out there
But I use Flask in Hubert
With a wrapper that puts all of the state inside a classMe:
I think we probably won't need something as..."flexible" as Hubert so maybe flask will be fine
Friend 2:
I think it'll be fine
Trying to figure out how to hotswap servers in the flask app and am struggling mightily
I think I just probably don't know enough about how it works internally to do this efficiently. arechnitzer , should I just push what I've done so far to a new branch?
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")
General approach:
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.
Details:
__init__()
methods to CanvasServer
and CanvasServerState
so that we can do something like CanvasServer(course, assignment)
CanvasServer.directory
based on course
and assignment
instead of using a hardcoded path (already implemented a few days ago)LiveServers
that holds a list of all currently-running CanvasServer
objects LiveServers
and 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?"