1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Include plugin info in --debug output (#1165)

* Include plugin info in `--debug` output

* Adapt issue number

* Fix docs
This commit is contained in:
Mickaël Schoentgen
2021-09-23 17:15:14 +02:00
committed by GitHub
parent 1535d0c976
commit 474093acdf
4 changed files with 13 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ from typing import Dict, List, Type
from pkg_resources import iter_entry_points
from ..utils import repr_dict
from . import AuthPlugin, ConverterPlugin, FormatterPlugin
from .base import BasePlugin, TransportPlugin
@@ -65,5 +66,13 @@ class PluginManager(list):
def get_transport_plugins(self) -> List[Type[TransportPlugin]]:
return self.filter(TransportPlugin)
def __str__(self):
return repr_dict({
'adapters': self.get_transport_plugins(),
'auth': self.get_auth_plugins(),
'converters': self.get_converters(),
'formatters': self.get_formatters(),
})
def __repr__(self):
return f'<PluginManager: {list(self)}>'
return f'<{type(self).__name__} {self}>'