Skip to content

Commit 8e2d543

Browse files
committed
Replaced Server.poll() return with str
1 parent cc75a5a commit 8e2d543

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

adafruit_httpserver/server.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
from .status import BAD_REQUEST_400, UNAUTHORIZED_401, FORBIDDEN_403, NOT_FOUND_404
3434

3535

36-
NO_REQUEST = 0
37-
CONNECTION_TIMED_OUT = 1
38-
REQUEST_HANDLED_NO_RESPONSE = 2
39-
REQUEST_HANDLED_RESPONSE_SENT = 3
36+
NO_REQUEST = "no_request"
37+
CONNECTION_TIMED_OUT = "connection_timed_out"
38+
REQUEST_HANDLED_NO_RESPONSE = "request_handled_no_response"
39+
REQUEST_HANDLED_RESPONSE_SENT = "request_handled_response_sent"
4040

4141

4242
class Server: # pylint: disable=too-many-instance-attributes
@@ -324,12 +324,12 @@ def _set_default_server_headers(self, response: Response) -> None:
324324
name, value
325325
)
326326

327-
def poll(self) -> int:
327+
def poll(self) -> str:
328328
"""
329329
Call this method inside your main loop to get the server to check for new incoming client
330330
requests. When a request comes in, it will be handled by the handler function.
331331
332-
Returns int representing the result of the poll
332+
Returns str representing the result of the poll
333333
e.g. ``NO_REQUEST`` or ``REQUEST_HANDLED_RESPONSE_SENT``.
334334
"""
335335
if self.stopped:

0 commit comments

Comments
 (0)