1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
from typing import TYPE_CHECKING
from jsonschema_path.handlers.file import FileHandler
from jsonschema_path.handlers.urllib import UrllibHandler
if TYPE_CHECKING:
from jsonschema_path.handlers.urllib import UrllibHandler as UrlHandler
else:
try:
from jsonschema_path.handlers.requests import (
UrlRequestsHandler as UrlHandler,
)
except ImportError:
from jsonschema_path.handlers.urllib import UrllibHandler as UrlHandler
__all__ = ["FileHandler", "UrlHandler"]
file_handler = FileHandler()
all_urls_handler = UrllibHandler("http", "https", "file")
default_handlers = {
"<all_urls>": all_urls_handler,
"http": UrlHandler("http"),
"https": UrlHandler("https"),
"file": UrllibHandler("file"),
}
|