mirror of
https://github.com/httpie/cli.git
synced 2025-01-07 23:01:53 +02:00
Cleanup
This commit is contained in:
parent
687a6a734d
commit
996e314482
@ -16,12 +16,11 @@ DEFAULT_UA = 'HTTPie/%s' % __version__
|
||||
|
||||
|
||||
def get_requests_session():
|
||||
|
||||
requests_session = requests.Session()
|
||||
for adapter_plugin_cls in plugin_manager.get_adapter_plugins():
|
||||
adapter_plugin = adapter_plugin_cls()
|
||||
requests_session.mount(prefix=adapter_plugin.prefix,
|
||||
adapter=adapter_plugin.get_adapter())
|
||||
for cls in plugin_manager.get_trasnsport_plugins():
|
||||
transport_plugin = cls()
|
||||
requests_session.mount(prefix=transport_plugin.prefix,
|
||||
adapter=transport_plugin.get_adapter())
|
||||
return requests_session
|
||||
|
||||
|
||||
|
@ -60,6 +60,6 @@ class PluginManager(object):
|
||||
if issubclass(plugin, ConverterPlugin)]
|
||||
|
||||
# Adapters
|
||||
def get_adapter_plugins(self):
|
||||
def get_trasnsport_plugins(self):
|
||||
return [plugin for plugin in self
|
||||
if issubclass(plugin, TransportPlugin)]
|
||||
|
Loading…
Reference in New Issue
Block a user