Skip to content

Commit 3480264

Browse files
committed
catcher.install 함수를 install_httpx으로 이름 변경
1 parent 3855706 commit 3480264

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/httpc/catcher/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ._catcher import AsyncCatcherTransport, ModeType, install, install_httpc
1+
from ._catcher import AsyncCatcherTransport, ModeType, install_httpx, install_httpc
22
from ._db import DBError, TransactionDatabase
33

44
__version__ = "0.1.0"
@@ -7,6 +7,6 @@
77
"DBError",
88
"ModeType",
99
"TransactionDatabase",
10-
"install",
10+
"install_httpx",
1111
"install_httpc",
1212
]

src/httpc/catcher/_catcher.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
from ._db import TransactionDatabase
1010

11-
type VerifyType = ssl.SSLContext | str | bool
12-
type PathType = PathLike | str | bytes
13-
type ContentKey = tuple[str, str, bytes]
14-
type ModeType = Literal["store", "use", "hybrid", "passive"]
11+
VerifyType = ssl.SSLContext | str | bool
12+
PathType = PathLike | str | bytes
13+
ContentKey = tuple[str, str, bytes]
14+
ModeType = Literal["store", "use", "hybrid", "passive"]
1515

1616
DEFAULT_LOGGER = logging.getLogger(__name__)
17-
_installed = False
17+
_installed_httpx = False
1818
_httpc_installed = False
1919

2020

@@ -92,9 +92,9 @@ async def handle_async_request(self, request: httpx.Request) -> httpx.Response:
9292
return response
9393

9494

95-
def install(db_path: PathType, mode: ModeType):
96-
global _installed
97-
if _installed:
95+
def install_httpx(db_path: PathType, mode: ModeType):
96+
global _installed_httpx
97+
if _installed_httpx:
9898
return
9999

100100
import atexit
@@ -107,7 +107,7 @@ def install(db_path: PathType, mode: ModeType):
107107
# monkey patching transport
108108
httpx.AsyncClient.__init__.__kwdefaults__["transport"] = transport
109109

110-
_installed = True
110+
_installed_httpx = True
111111

112112

113113
def install_httpc(db_path: PathType, mode: ModeType):

0 commit comments

Comments
 (0)