O_o
We are getting off-topic a little... maybe. With respect to others, and Epy in particular, I'll go elsewhere if desired.
One part of the Python code is a bit of purposeful server, started by a `systemd` service file with a user and group having permissions to access the scanner hardware, which reads jobs from a domain socket and knows how to complete transactions with a HTTP POST request.
The other part of the Python code is a bit of "RESTful" (I do so very hate the word.) FCGI server, also started by a `systemd` service file but with a user and group which only has permissions to write to the domain socket and database, handles the database stuff and is responsible for requesting a scan as well as receives responses when the scan is finished.
[Edit]
I didn't just use CGI because I didn't want to run the HTTP server as an account with hardware permissions and the scanner may take a very long time.
[/Edit]
The user just opens a page up from a bookmark and Javascript throws a POST at the HTTP server.
Just short of literally:
http://address:port/scan?pid=whateve...r&res=whatever
Soma