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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 2 deletions

View File

@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- Fixed duplicate keys preservation of JSON data. ([#1163](https://github.com/httpie/httpie/issues/1163))
- Added support for formatting & coloring of JSON bodies preceded by non-JSON data (e.g., an XXSI prefix). ([#1130](https://github.com/httpie/httpie/issues/1130))
- Installed plugins are now listed in `--debug` output. ([#1165](https://github.com/httpie/httpie/issues/1165))
## [2.5.0](https://github.com/httpie/httpie/compare/2.4.0...2.5.0) (2021-09-06)

View File

@ -1200,7 +1200,6 @@ Use one of these options to control output processing:
| `--pretty=format` | Apply formatting |
| `--pretty=none` | Disables output processing. Default for redirected output |
Formatting has the following effects:
- HTTP headers are sorted by name.

View File

@ -227,6 +227,8 @@ def print_debug_info(env: Environment):
])
env.stderr.write('\n\n')
env.stderr.write(repr(env))
env.stderr.write('\n\n')
env.stderr.write(repr(plugin_manager))
env.stderr.write('\n')

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}>'