Ejemplo n.º 1
0
 def wait_active(self, timeout = 0):
     import time
     sleep = .05
     start = time.time()
     parent_id = _xautpy.find_outer_parent(self.id)
     while(1):
         active_id = _xautpy.active_window()
         active_parent_id = _xautpy.find_outer_parent(active_id)
         if(parent_id == active_parent_id):
             return True
         #A crude timeout function.  Using threads and interrupts
         #is too complicated for such a simple loop.
         if(timeout > 0):
             now = time.time()
             if((now - start) >= timeout):
                 return False
         time.sleep(sleep)
Ejemplo n.º 2
0
 def wait_active(self, timeout = 0):
     import time
     sleep = .05
     start = time.time()
     parent_id = _xautpy.find_outer_parent(self.id)
     while(1):
         active_id = _xautpy.active_window()
         active_parent_id = _xautpy.find_outer_parent(active_id)
         if(parent_id == active_parent_id):
             return True
         #A crude timeout function.  Using threads and interrupts
         #is too complicated for such a simple loop.
         if(timeout > 0):
             now = time.time()
             if((now - start) >= timeout):
                 return False
         time.sleep(sleep)
Ejemplo n.º 3
0
 def find_outer_parent(self):
     op_id = _xautpy.find_outer_parent(self.id)
     if op_id > 0:
         return window(op_id)
     else:
         return None
Ejemplo n.º 4
0
 def is_active(self):
     active_id = _xautpy.active_window()
     return _xautpy.find_outer_parent(active_id) == _xautpy.find_outer_parent(self.id)
Ejemplo n.º 5
0
 def find_outer_parent(self):
     op_id = _xautpy.find_outer_parent(self.id)
     if op_id > 0:
         return window(op_id)
     else:
         return None
Ejemplo n.º 6
0
 def is_active(self):
     active_id = _xautpy.active_window()
     return _xautpy.find_outer_parent(
         active_id) == _xautpy.find_outer_parent(self.id)