forked from extern/httpie-cli
parent
27d57ce773
commit
cd085cbc0d
@ -18,7 +18,7 @@ from httpie.cli.constants import (
|
||||
from httpie.cli.exceptions import ParseError
|
||||
from httpie.cli.requestitems import RequestItems
|
||||
from httpie.context import Environment
|
||||
from httpie.plugins import plugin_manager
|
||||
from httpie.plugins.registry import plugin_manager
|
||||
from httpie.utils import ExplicitNullAuth, get_content_type
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ from httpie.cli.constants import (
|
||||
from httpie.output.formatters.colors import (
|
||||
AUTO_STYLE, AVAILABLE_STYLES, DEFAULT_STYLE,
|
||||
)
|
||||
from httpie.plugins import plugin_manager
|
||||
from httpie.plugins.registry import plugin_manager
|
||||
from httpie.plugins.builtin import BuiltinAuthPlugin
|
||||
from httpie.sessions import DEFAULT_SESSIONS_DIR
|
||||
from httpie.ssl import DEFAULT_SSL_CIPHERS, AVAILABLE_SSL_VERSION_ARG_MAPPING
|
||||
|
@ -14,7 +14,7 @@ import urllib3
|
||||
|
||||
from httpie import __version__
|
||||
from httpie.cli.dicts import RequestHeadersDict
|
||||
from httpie.plugins import plugin_manager
|
||||
from httpie.plugins.registry import plugin_manager
|
||||
from httpie.sessions import get_httpie_session
|
||||
from httpie.ssl import AVAILABLE_SSL_VERSION_ARG_MAPPING, HTTPieHTTPSAdapter
|
||||
from httpie.utils import repr_dict
|
||||
|
@ -13,10 +13,11 @@ from httpie.client import collect_messages
|
||||
from httpie.context import Environment
|
||||
from httpie.downloads import Downloader
|
||||
from httpie.output.writer import write_message, write_stream
|
||||
from httpie.plugins import plugin_manager
|
||||
from httpie.plugins.registry import plugin_manager
|
||||
from httpie.status import ExitStatus, http_status_to_exit_status
|
||||
|
||||
|
||||
# noinspection PyDefaultArgument
|
||||
def main(
|
||||
args: List[Union[str, bytes]] = sys.argv,
|
||||
env=Environment(),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import re
|
||||
from typing import Optional, List
|
||||
|
||||
from httpie.plugins import plugin_manager, ConverterPlugin
|
||||
from httpie.plugins import ConverterPlugin
|
||||
from httpie.plugins.registry import plugin_manager
|
||||
from httpie.context import Environment
|
||||
|
||||
|
||||
|
@ -7,18 +7,3 @@ from httpie.plugins.base import (
|
||||
AuthPlugin, FormatterPlugin,
|
||||
ConverterPlugin, TransportPlugin
|
||||
)
|
||||
from httpie.plugins.manager import PluginManager
|
||||
from httpie.plugins.builtin import BasicAuthPlugin, DigestAuthPlugin
|
||||
from httpie.output.formatters.headers import HeadersFormatter
|
||||
from httpie.output.formatters.json import JSONFormatter
|
||||
from httpie.output.formatters.colors import ColorFormatter
|
||||
|
||||
|
||||
plugin_manager = PluginManager()
|
||||
plugin_manager.register(
|
||||
BasicAuthPlugin,
|
||||
DigestAuthPlugin,
|
||||
HeadersFormatter,
|
||||
JSONFormatter,
|
||||
ColorFormatter,
|
||||
)
|
||||
|
18
httpie/plugins/registry.py
Normal file
18
httpie/plugins/registry.py
Normal file
@ -0,0 +1,18 @@
|
||||
from httpie.plugins.manager import PluginManager
|
||||
from httpie.plugins.builtin import BasicAuthPlugin, DigestAuthPlugin
|
||||
from httpie.output.formatters.headers import HeadersFormatter
|
||||
from httpie.output.formatters.json import JSONFormatter
|
||||
from httpie.output.formatters.colors import ColorFormatter
|
||||
|
||||
|
||||
plugin_manager = PluginManager()
|
||||
|
||||
|
||||
# Register all built-in plugins.
|
||||
plugin_manager.register(
|
||||
BasicAuthPlugin,
|
||||
DigestAuthPlugin,
|
||||
HeadersFormatter,
|
||||
JSONFormatter,
|
||||
ColorFormatter,
|
||||
)
|
@ -13,7 +13,7 @@ from requests.cookies import RequestsCookieJar, create_cookie
|
||||
|
||||
from httpie.cli.dicts import RequestHeadersDict
|
||||
from httpie.config import BaseConfigDict, DEFAULT_CONFIG_DIR
|
||||
from httpie.plugins import plugin_manager
|
||||
from httpie.plugins.registry import plugin_manager
|
||||
|
||||
|
||||
SESSIONS_DIR_NAME = 'sessions'
|
||||
|
@ -1,9 +1,11 @@
|
||||
from mock import mock
|
||||
|
||||
from httpie.cli.constants import SEPARATOR_CREDENTIALS
|
||||
from httpie.plugins import AuthPlugin, plugin_manager
|
||||
from httpie.plugins import AuthPlugin
|
||||
from httpie.plugins.registry import plugin_manager
|
||||
from utils import http, HTTP_OK
|
||||
|
||||
|
||||
# TODO: run all these tests in session mode as well
|
||||
|
||||
USERNAME = 'user'
|
||||
|
Loading…
Reference in New Issue
Block a user