def lit(self, query, upper_bound, finished, *args, **kargs): self.worker.do( make=lambda: WindowModel( self.sorted_active_runnable( query, winutils.top_level_windows() )[:upper_bound] ), catch=finished, main=True )
def main(argv): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(('', PORT)) s.listen(1) conn, addr = s.accept() while True: line = conn.recv(1024).decode(ENCODING) if line == 'exit': break elif line == 'all': print(windows.top_level_windows()) else: windows.goto(int(line)) print(line)
def select(self, content, index): # check content type if not isinstance(content, WindowModel): logging.info('wrong content type {}'.format(type(content))) return for hwnd in winutils.top_level_windows(): if content.data(index, WindowModel.HWND_ROLE) == hwnd: self._refresh_tasks([hwnd]) self.client.goto(hwnd=hwnd) self.update_usetime(hwnd) return # remove invalid tasks del self.tasks[content.data(index, WindowModel.HWND_ROLE)]
def lit(self, query, upper_bound, finished, *args, **kargs): self.worker.do(make=lambda: WindowModel( self.sorted_active_runnable(query, winutils.top_level_windows()) [:upper_bound]), catch=finished, main=True)