23 lines
462 B
Python
23 lines
462 B
Python
from __future__ import annotations
|
|
|
|
from .cell_agent import build_from_env
|
|
|
|
|
|
def main() -> None:
|
|
service, server = build_from_env()
|
|
try:
|
|
server.serve_forever()
|
|
except KeyboardInterrupt:
|
|
return
|
|
finally:
|
|
server.shutdown()
|
|
server.server_close()
|
|
service.close()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
try:
|
|
main()
|
|
except ValueError as exc:
|
|
raise SystemExit(f"configuration error: {exc}") from exc
|