(cls, uri: str, opts: Optional[dict] = None)
| 193 | |
| 194 | @classmethod |
| 195 | def from_uri(cls, uri: str, opts: Optional[dict] = None) -> DiffOutputBase: |
| 196 | parsed = parse.urlparse(uri) |
| 197 | parsed_qs = dict(parse.parse_qsl(parsed.query, keep_blank_values=True)) |
| 198 | |
| 199 | if opts is None: |
| 200 | opts = {} |
| 201 | |
| 202 | fmt_class = cls.get_format(uri, parsed) |
| 203 | |
| 204 | if parsed.netloc and parsed.path: |
| 205 | opts["output_location"] = os.path.join(parsed.netloc, parsed.path) |
| 206 | elif uri != fmt_class.protocol(): |
| 207 | opts["output_location"] = parsed.netloc or parsed.path |
| 208 | |
| 209 | for opt in ("detections", "all_detections", "output_same_renames", "patch"): |
| 210 | if opt in parsed_qs: |
| 211 | opts[opt] = qs_to_bool(parsed_qs[opt]) |
| 212 | |
| 213 | return fmt_class(**opts) |
| 214 | |
| 215 | def filtered(self, diffs: List[DiffType]) -> List[DiffType]: |
| 216 | out = [] |
nothing calls this directly
no test coverage detected