(self, path: Path, data: List[str])
| 136 | f.write(data if isinstance(data, str) else str(data)) |
| 137 | |
| 138 | def write_law(self, path: Path, data: List[str]): |
| 139 | out_path = self.base_path / "out" |
| 140 | if not out_path.exists(): |
| 141 | out_path.mkdir() |
| 142 | full_path = out_path / path |
| 143 | folder_path = full_path.parents[0] |
| 144 | if not folder_path.exists(): |
| 145 | folder_path.mkdir() |
| 146 | with open(full_path, "w") as f: |
| 147 | result = "\n\n".join(data) |
| 148 | result = result.replace("<!-- TABLE -->\n", "<!-- TABLE -->") |
| 149 | result = result.replace("\n<!-- TABLE END -->", "<!-- TABLE END -->") |
| 150 | result = result.replace("|\n\n|", "|\n|") |
| 151 | result = re.sub("\n{2,}", "\n\n", result) |
| 152 | f.write(result) |
| 153 | |
| 154 | |
| 155 | class RequestManager(object): |
no test coverage detected