コード例 #1
0
ファイル: go.py プロジェクト: 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
     )
コード例 #2
0
ファイル: goto.py プロジェクト: 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)
コード例 #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)
コード例 #4
0
ファイル: go.py プロジェクト: 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)]
コード例 #5
0
ファイル: go.py プロジェクト: kazarin1alex/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)]
コード例 #6
0
ファイル: go.py プロジェクト: kazarin1alex/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)