DynAIkonTrap.server.web_serve#
Classes
|
A handler class which inherits from http.server.SimpleHTTPRequestHandler. |
|
The observation server handles HTML generation, running the HTTP server and starting the Shellinabox daemon. |
|
A class to handle running a service daemon on a separate thread using subprocess.call. |
- class Handler(callback, *args, **kwargs)#
A handler class which inherits from http.server.SimpleHTTPRequestHandler. The method, do_GET() is overwritten to intercept GET requests for camera-fov.jpg.
- do_GET()#
Serve a GET request.
- class ObservationServer(output_settings: OutputSettings, logger_settings: LoggerSettings, read_image_from: Union[Camera, CameraToDisk])#
The observation server handles HTML generation, running the HTTP server and starting the Shellinabox daemon.
Initialises ObservationServer.
- Parameters:
output_settings (OutputSettings) β Needs output_settings to determine the output directory to serve
logger_settings (LoggerSettings) β Needs logger_settings to determine the log file to serve
read_image_from (Union[Camera, CameraToDisk]) β Needs an object to read images from for FOV refresh
- createFOVPage()#
Calls html_generator to make the FOV page.
- createHomePage()#
Calls the html_generator to make the main page.
- createLogLink()#
Creates a symbolic link to the log file so itβs accessible to the server
- createObservationsHTML()#
Calls the html_generator to make the observations html.
- createShellPage()#
Calls the html_generator to make the shell page.
- get_ip()#
Simple method to get the IP address of this device. See: https://stackoverflow.com/questions/166506/finding-local-ip-addresses-using-pythons-stdlib
- run()#
Runs the server if the OS allows it, otherwise, error message is written to the log.