Doc strings to imperative mood

This commit is contained in:
Julian Stirling 2025-07-10 00:36:23 +01:00
parent dceb640c77
commit f51dae7b3a
10 changed files with 88 additions and 79 deletions

View file

@ -12,7 +12,10 @@ def add_v2_endpoints(thing_server: lt.ThingServer):
# This is necessary until Connect is rebuilt.
@app.get("/routes")
def routes_stub() -> dict[str, dict]:
"""A stub list of routes, used by OF Connect to identify the microscope"""
"""Return a stub list of routes.
This is used by OF Connect to identify the microscope.
"""
fake_routes = [
"/api/v2/",
"/api/v2/streams/snapshot",
@ -26,11 +29,11 @@ def add_v2_endpoints(thing_server: lt.ThingServer):
@app.get("/api/v2/streams/snapshot")
@app.head("/api/v2/streams/snapshot")
async def thumbnail() -> JPEGResponse:
"""A low-resolution snapshot, for compatibility with OF connect"""
"""Return a low-resolution snapshot, for compatibility with OF connect."""
blob = await thing_server.things["/camera/"].lores_mjpeg_stream.grab_frame()
return JPEGResponse(blob)
@app.get("/api/v2/instrument/settings/name")
def get_hostname() -> str:
"""Get the hostname of the device, for compatibility with OF connect"""
"""Get the hostname of the device, for compatibility with OF connect."""
return gethostname()