(self, scan_output)
| 461 | handler.wfile.write(json.dumps({"error": str(e)}).encode('utf-8')) |
| 462 | |
| 463 | def parse_scan_result(self, scan_output): |
| 464 | networks = [] |
| 465 | for line in scan_output.split('\n'): |
| 466 | if 'ESSID' in line: |
| 467 | ssid = line.split(':')[1].strip('"') |
| 468 | if ssid not in networks: |
| 469 | networks.append(ssid) |
| 470 | return networks |
| 471 | |
| 472 | def connect_wifi(self, handler): |
| 473 | try: |