(self, params: Union[str, dict], **kwargs)
| 498 | } |
| 499 | |
| 500 | def call(self, params: Union[str, dict], **kwargs) -> Union[str, list]: |
| 501 | params = self._verify_json_format_args(params) |
| 502 | file_path = self._prepare_file(params['url']) |
| 503 | try: |
| 504 | cached = self.db.get(f'{hash_sha256(file_path)}_ori') |
| 505 | return self._flatten_result(json.loads(cached)) |
| 506 | except KeyNotExistsError: |
| 507 | return self._flatten_result(self._process_new_file(file_path)) |
| 508 | |
| 509 | def _prepare_file(self, path: str) -> str: |
| 510 | if is_http_url(path): |
nothing calls this directly
no test coverage detected