Пример #1
0
 def active_window():
     id = _xautpy.active_window()
     if(id):
         win = window(id)
         return win
     else:
         return None
Пример #2
0
 def active_window():
     id = _xautpy.active_window()
     if(id):
         win = window(id)
         return win
     else:
         return None
Пример #3
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)
Пример #4
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)
Пример #5
0
 def is_active(self):
     active_id = _xautpy.active_window()
     return _xautpy.find_outer_parent(active_id) == _xautpy.find_outer_parent(self.id)
Пример #6
0
 def is_active(self):
     active_id = _xautpy.active_window()
     return _xautpy.find_outer_parent(
         active_id) == _xautpy.find_outer_parent(self.id)