Ejemplo n.º 1
0
 def stop_application(self):
     if not self.is_app_running(self.APP_BACKDROP):
         self.socket.send(commands.StopCommand())
         start_time = time.time()
         while not self.is_app_running(None):
             self.socket.send_and_wait(commands.StatusCommand())
             current_time = time.time()
             if current_time - start_time > self.timeout:
                 raise TimeoutException()
             time.sleep(self.WAIT_INTERVAL)
     else:
         logger.debug('Stop not necessary. Backdrop is running ...')
Ejemplo n.º 2
0
 def stop_application(self):
     if not self.is_app_running(self.APP_BACKDROP):
         self.socket.send(commands.StopCommand())
         retries = 0
         while not self.is_app_running(self.APP_BACKDROP):
             if retries > self.max_retries:
                 return False
             self.socket.send_and_wait(commands.StatusCommand())
             time.sleep(1)
             retries += 1
         return True
     else:
         logger.debug('Stop not necessary. Backdrop is running ...')
         return True