libkak.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:libkak 作者: danr 项目源码 文件源码
def _test_remote_commands_async():
    u"""
    >>> kak = headless()
    >>> @Remote.command(kak.pid)
    ... def write_position(pipe, line, column):
    ...      pipe(utils.join(('exec ', 'a', str(line), ':', str(column), '<esc>'), sep=''))
    >>> pipe(kak.pid, 'write-position', 'unnamed0')
    >>> time.sleep(0.05)
    >>> pipe(kak.pid, 'exec a,<space><esc>', 'unnamed0', sync=True)
    >>> time.sleep(0.02)
    >>> write_position('unnamed0')
    >>> pipe(kak.pid, 'exec \%H', 'unnamed0', sync=True)
    >>> Remote.onclient(kak.pid, 'unnamed0')(lambda selection: print(selection))
    1:1, 1:5
    >>> q = Queue()
    >>> Remote.onclient(kak.pid, 'unnamed0', sync=False)(lambda selection: q.put(selection))
    >>> print(q.get())
    1:1, 1:5
    >>> pipe(kak.pid, 'quit!', 'unnamed0')
    >>> kak.wait()
    0
    >>> _fifo_cleanup()
    """
    pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号