(self, file_path, publish_at=None)
| 578 | self.cache.write_law(output_path, filedata) |
| 579 | |
| 580 | def parse_file(self, file_path, publish_at=None): |
| 581 | result = {} |
| 582 | with open(file_path, "r") as f: |
| 583 | data = list(filter(lambda x: x, map( |
| 584 | lambda x: x.strip(), f.readlines()))) |
| 585 | title = data[0] |
| 586 | filedata = self.content_parser.parse(result, title, data[1], data[2:]) |
| 587 | if not filedata: |
| 588 | return |
| 589 | output_path = self.__get_law_output_path(title, publish_at) |
| 590 | logger.debug(f"parsing {title} success") |
| 591 | self.cache.write_law(output_path, filedata) |
| 592 | |
| 593 | def get_file_hash(self, title, publish_at=None) -> str: |
| 594 | _hash = md5() |
no test coverage detected