23 lines
494 B
Python
23 lines
494 B
Python
from __future__ import annotations
|
|
|
|
from .sip_management import ConfigurationError, 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 ConfigurationError as exc:
|
|
raise SystemExit(f"configuration error: {exc}") from exc
|