(file_path: Path, max_lines: int = 200)
| 551 | |
| 552 | |
| 553 | def tail_lines(file_path: Path, max_lines: int = 200) -> list[str]: |
| 554 | if not file_path.exists(): |
| 555 | return [] |
| 556 | lines: deque[str] = deque(maxlen=max_lines) |
| 557 | with file_path.open("r", encoding="utf-8", errors="replace") as handle: |
| 558 | for line in handle: |
| 559 | stripped = line.rstrip() |
| 560 | if stripped: |
| 561 | lines.append(stripped) |
| 562 | return list(lines) |
| 563 | |
| 564 | |
| 565 | def recent_mobile_requests(limit: int = 6) -> list[dict[str, Any]]: |
no outgoing calls
no test coverage detected