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

Method get_format

aura/output/base.py:48–58  ·  view source on GitHub ↗
(cls, uri: str, parsed=None)

Source from the content-addressed store, hash-verified

46
47 @classmethod
48 def get_format(cls, uri: str, parsed=None) -> OutputBase:
49 if not parsed:
50 parsed = parse.urlparse(uri)
51
52 for fmt_name, fmt in cls.get_all_output_formats().items():
53 if fmt_name == uri: # This will match also "protocol" so we don't need to specify "protocol://"
54 return fmt
55 elif fmt.is_supported(parsed_uri=parsed):
56 return fmt
57
58 raise exceptions.InvalidOutput(f"No such output format `{uri}`")
59
60
61@dataclass()

Callers 4

from_uriMethod · 0.80
from_uriMethod · 0.80
from_uriMethod · 0.80
from_uriMethod · 0.80

Calls 2

is_supportedMethod · 0.45

Tested by

no test coverage detected