Esempio n. 1
0
File: go.py Progetto: Answeror/lit
 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
     )
Esempio n. 2
0
File: goto.py Progetto: Answeror/lit
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)
Esempio n. 3
0
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)
Esempio n. 4
0
File: go.py Progetto: Answeror/lit
    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)]
Esempio n. 5
0
    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)]
Esempio n. 6
0
 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)