MCPcopy Create free account
hub / github.com/tox-dev/filelock / __call__

Method __call__

src/filelock/asyncio.py:71–98  ·  view source on GitHub ↗
(  # type: ignore[override] # noqa: PLR0913
        cls,  # noqa: N805
        lock_file: str | os.PathLike[str],
        timeout: float = -1,
        mode: int = 0o644,
        thread_local: bool = False,  # noqa: FBT001, FBT002
        *,
        blocking: bool = True,
        is_singleton: bool = False,
        loop: asyncio.AbstractEventLoop | None = None,
        run_in_executor: bool = True,
        executor: futures.Executor | None = None,
    )

Source from the content-addressed store, hash-verified

69
70class AsyncFileLockMeta(FileLockMeta):
71 def __call__( # type: ignore[override] # noqa: PLR0913
72 cls, # noqa: N805
73 lock_file: str | os.PathLike[str],
74 timeout: float = -1,
75 mode: int = 0o644,
76 thread_local: bool = False, # noqa: FBT001, FBT002
77 *,
78 blocking: bool = True,
79 is_singleton: bool = False,
80 loop: asyncio.AbstractEventLoop | None = None,
81 run_in_executor: bool = True,
82 executor: futures.Executor | None = None,
83 ) -> BaseAsyncFileLock:
84 if thread_local and run_in_executor:
85 msg = "run_in_executor is not supported when thread_local is True"
86 raise ValueError(msg)
87 instance = super().__call__(
88 lock_file=lock_file,
89 timeout=timeout,
90 mode=mode,
91 thread_local=thread_local,
92 blocking=blocking,
93 is_singleton=is_singleton,
94 loop=loop,
95 run_in_executor=run_in_executor,
96 executor=executor,
97 )
98 return cast(BaseAsyncFileLock, instance)
99
100
101class BaseAsyncFileLock(BaseFileLock, metaclass=AsyncFileLockMeta):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected