MCPcopy
hub / github.com/treeverse/dvc / lock

Method lock

dvc/lock.py:196–208  ·  view source on GitHub ↗
(self, timeout: Optional[Union[timedelta, int]] = None)

Source from the content-addressed store, hash-verified

194 self._friendly = kwargs.get("friendly", False)
195
196 def lock(self, timeout: Optional[Union[timedelta, int]] = None):
197 try:
198 if not self._wait:
199 timeout = timeout or timedelta(seconds=DEFAULT_TIMEOUT)
200
201 with Tqdm(
202 bar_format="{desc}",
203 disable=not (self._wait and self._friendly),
204 desc="Waiting to acquire lock",
205 ):
206 super().lock(timeout)
207 except flufl.lock.TimeOutError:
208 raise LockError(FAILED_TO_LOCK_MESSAGE) # noqa: B904
209
210 def _set_claimfile(self):
211 super()._set_claimfile()

Callers

nothing calls this directly

Calls 3

TqdmClass · 0.90
LockErrorClass · 0.85
lockMethod · 0.45

Tested by

no test coverage detected