(self, diff_analyzer: DiffAnalyzerType)
| 63 | self._fd.close() |
| 64 | |
| 65 | def output_diff(self, diff_analyzer: DiffAnalyzerType): |
| 66 | payload = { |
| 67 | "tables": [], |
| 68 | "diffs": [] |
| 69 | } |
| 70 | |
| 71 | for table in diff_analyzer.tables: |
| 72 | payload["tables"].append(table.asdict()) |
| 73 | |
| 74 | for d in self.filtered(diff_analyzer.diffs): # type: DiffType |
| 75 | diff = d.as_dict() |
| 76 | if not self.patch: |
| 77 | diff.pop("diff", None) |
| 78 | |
| 79 | payload["diffs"].append(diff) |
| 80 | |
| 81 | print(dumps(payload), file=self._fd) |
| 82 | |
| 83 | |
| 84 | class JSONTyposquattingOutput(TyposquattingOutputBase): |