| 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() |