MCPcopy Index your code
hub / github.com/httpie/cli / Interface

Class Interface

tests/utils/plugins_cli.py:106–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104
105@dataclass
106class Interface:
107 path: Path
108 environment: Environment
109
110 def get_plugin(self, target: str) -> importlib_metadata.Distribution:
111 with enable_plugins(self.environment.config.plugins_dir):
112 return importlib_metadata.distribution(target)
113
114 def is_installed(self, target: str) -> bool:
115 try:
116 self.get_plugin(target)
117 except ModuleNotFoundError:
118 return False
119 else:
120 return True
121
122 def make_dummy_plugin(self, build=True, **kwargs) -> Plugin:
123 kwargs.setdefault('entry_points', [EntryPoint('test', 'httpie.plugins.auth.v1')])
124
125 plugin = Plugin(self, **kwargs)
126 if build:
127 plugin.build()
128 return plugin
129
130
131def parse_listing(lines: List[str]) -> Dict[str, Any]:

Callers 1

interfaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected