diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d291a07..ea9c75e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: "--fix", "--ignore-path", ".gitignore", - "ui/", + "src/", ] - repo: https://github.com/asottile/pyupgrade diff --git a/dsf/http_endpoints.py b/dsf/http_endpoints.py index bc05bc4..9c1ec46 100644 --- a/dsf/http_endpoints.py +++ b/dsf/http_endpoints.py @@ -4,10 +4,10 @@ from dsf.http import HttpEndpointConnection, HttpEndpointType -async def get_connection_status(http_endpoint_connection: HttpEndpointConnection): - await http_endpoint_connection.read_request() - await http_endpoint_connection.send_response(200, "ok") - http_endpoint_connection.close() +async def get_connection_status(endpoint: HttpEndpointConnection): + await endpoint.read_request() + await endpoint.send_response(200, "ok") + endpoint.close() def register_http_endpoints(): @@ -15,11 +15,14 @@ def register_http_endpoints(): cmd_conn.connect() # Register the connection status endpoint - endpoint = cmd_conn.add_http_endpoint(HttpEndpointType.GET, "printnanny", "connection-status") + endpoint = cmd_conn.add_http_endpoint( + HttpEndpointType.GET, "printnanny", "connection-status" + ) # Register the handler to reply on requests endpoint.set_endpoint_handler(get_connection_status) hostname = socket.gethostname() - print(f"Connection status available from http://{hostname}/machine/printnanny/connection-status") + url = f"http://{hostname}/machine/printnanny/connection-status" + print(f"Connection status available from {url}") return cmd_conn, endpoint diff --git a/version.txt b/version.txt index 6c6aa7c..6e8bf73 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.1.0 \ No newline at end of file +0.1.0