X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;ds=sidebyside;f=task.py;fp=task.py;h=4774c8c51597c934b73be4462b2a1d2688ab0b03;hb=bf0868a41a86ea5952d5fc1a8fca6621e89ad42e;hp=3af1cacadc4c30700ef18c748ff81ee9f9a01ed2;hpb=7c7602eae676c9806292ad37c58d22dcce12a14f;p=plomtask diff --git a/task.py b/task.py index 3af1cac..4774c8c 100755 --- a/task.py +++ b/task.py @@ -18,13 +18,13 @@ class HandledException(Exception): class TaskHandler(BaseHTTPRequestHandler): """Handles single HTTP request.""" - def send_html(self, html, code=200): + def send_html(self, html:str, code:int=200): """Send HTML as proper HTTP response.""" self.send_response(code) self.end_headers() self.wfile.write(bytes(html, 'utf-8')) - def send_msg(self, msg, code=400): + def send_msg(self, msg:str, code:int=400): """Send message in HTML formatting as HTTP response.""" html = self.server.jinja.get_template('msg.html').render(msg=msg) self.send_html(html, code)