| 330 | return html |
| 331 | |
| 332 | def serve_file(self, handler, filename): |
| 333 | try: |
| 334 | with open(os.path.join(self.shared_data.webdir, filename), 'r', encoding='utf-8') as file: |
| 335 | content = file.read() |
| 336 | content = content.replace('{{ web_delay }}', str(self.shared_data.web_delay * 1000)) |
| 337 | handler.send_response(200) |
| 338 | handler.send_header("Content-type", "text/html") |
| 339 | handler.end_headers() |
| 340 | handler.wfile.write(content.encode('utf-8')) |
| 341 | except FileNotFoundError: |
| 342 | handler.send_response(404) |
| 343 | handler.end_headers() |
| 344 | |
| 345 | def serve_current_config(self, handler): |
| 346 | handler.send_response(200) |