MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / from_uri

Method from_uri

aura/output/base.py:195–213  ·  view source on GitHub ↗
(cls, uri: str, opts: Optional[dict] = None)

Source from the content-addressed store, hash-verified

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 = []

Callers

nothing calls this directly

Calls 4

qs_to_boolFunction · 0.85
get_formatMethod · 0.80
joinMethod · 0.80
protocolMethod · 0.45

Tested by

no test coverage detected