PiClock project

This commit is contained in:
2024-01-03 09:59:59 +01:00
parent edc186dbd4
commit ca21954980
9 changed files with 1737 additions and 0 deletions

9
web_tools.py Normal file
View File

@@ -0,0 +1,9 @@
def result_ok(cl, response = None, content_type = "text/plain"):
cl.send('HTTP/1.0 200 OK\r\nContent-type: ' + content_type + '\r\n\r\n')
cl.send(response if response is not None else "Ok")
cl.close()
def result_notfound(cl, response = None):
cl.send('HTTP/1.0 404 NotFound\r\nContent-type: text/plain\r\n\r\n')
cl.send(response if response is not None else "Not Found")
cl.close()