Beispiel #1
0
    def exclusive_lock(self):
        def blocked_cb():  # pragma: no cover (tests are single-process)
            logger.info('Locking pre-commit directory')

        with file_lock.lock(os.path.join(self.directory, '.lock'), blocked_cb):
            yield
Beispiel #2
0
    def exclusive_lock(self):
        def blocked_cb():  # pragma: no cover (tests are single-process)
            logger.info('Locking pre-commit directory')

        with file_lock.lock(os.path.join(self.directory, '.lock'), blocked_cb):
            yield
Beispiel #3
0
    def exclusive_lock(self) -> Generator[None, None, None]:
        def blocked_cb() -> None:  # pragma: no cover (tests are in-process)
            logger.info('Locking pre-commit directory')

        with file_lock.lock(os.path.join(self.directory, '.lock'), blocked_cb):
            yield
Beispiel #4
0
 def exclusive_lock(self, quiet=False):
     if not quiet:
         logger.info('Locking pre-commit directory')
     with file_lock.lock(os.path.join(self.directory, '.lock')):
         yield