1
0
mirror of https://github.com/httpie/cli.git synced 2025-01-07 23:01:53 +02:00
This commit is contained in:
Jakub Roztocil 2015-02-05 15:55:20 +01:00
parent 687a6a734d
commit 996e314482
2 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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)]