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