How to use the evasdk.eva_errors.EvaLockError function in evasdk

To help you get started, we’ve selected a few evasdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github automata-tech / eva_python_sdk / evasdk / eva_locker.py View on Github external
def __try_renew(self):
        try:
            self.__eva.lock_renew()
        except Exception:
            raise EvaLockError("""'with eva:' context statements require a locked eva object, e.g. by using 'with eva.lock():',
             and not unlocking from within the statement.""")
github automata-tech / eva_python_sdk / evasdk / eva_locker.py View on Github external
self.__try_renew()

            self.__cond = threading.Condition()
            self.__thread = threading.Thread(target=self.__renewal_timer)

            self.__period_stack.append(self.__renew_period)
            self.__thread.start()
        else:
            with self.__cond:
                if self.__renew_period != self.__period_stack[-1]:
                    self.__try_renew()

                    self.__period_stack.append(self.__renew_period)
                    self.__reset_timer()
                else:
                    raise EvaLockError("""Unneccesary refresh of the lock renewal process,
                 lock is already being renewed with the configured period.""")