File: __init__.py

package info (click to toggle)
python-jsonschema-path 0.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 320 kB
  • sloc: python: 950; makefile: 3
file content (25 lines) | stat: -rw-r--r-- 761 bytes parent folder | download
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"),
}