(cmd)
| 501 | return response |
| 502 | |
| 503 | def run_cmd(cmd): |
| 504 | cmd = cmd.split("\n")[0] |
| 505 | |
| 506 | if cmd.startswith("SCROLL UP"): |
| 507 | _crawler.scroll("up") |
| 508 | elif cmd.startswith("SCROLL DOWN"): |
| 509 | _crawler.scroll("down") |
| 510 | elif cmd.startswith("CLICK"): |
| 511 | commasplit = cmd.split(",") |
| 512 | id = commasplit[0].split(" ")[1] |
| 513 | _crawler.click(id) |
| 514 | elif cmd.startswith("TYPE"): |
| 515 | spacesplit = cmd.split(" ") |
| 516 | id = spacesplit[1] |
| 517 | text = " ".join(spacesplit[2:]) |
| 518 | text = text[1:-1] |
| 519 | if cmd.startswith("TYPESUBMIT"): |
| 520 | text += '\n' |
| 521 | _crawler.type(id, text) |
| 522 | |
| 523 | time.sleep(2) |
| 524 | |
| 525 | gpt_cmd = "" |
| 526 | prev_cmd = "" |
no test coverage detected