[execnet-dev] testing vim with execnet

Adam Adam.Schmalhofer at gmx.de
Wed Nov 18 12:55:42 CET 2009


I am trying to test a vim-plugin (blogit.vim) via execnet (and py.test). I
let vim start the SocketServer (vim -c "pyfile socketserver.py"). I can
connect to it and run different vim commands (import vim;
vim.command("%s/a/e")).

However I can't access any of vim's python objects directly. I can only
let vim manipulate them (via vim.command) and exchange strings over
vim.current.buffer. e.g.:

    >>> channel = gw.remote_exec("""
    ... import vim
    ... vim.command("py b = 42")
    ... vim.command("py vim.current.buffer[0] = str(b)")
    ... channel.send(vim.current.buffer[0])    # works: '42'
    ... channel.send(b)    # fails: NameError
    ... """)

The other direction doesn't work either. The two have uncoupled
namespaces (it seems). unpickling strings exchanged over
vim.current.buffer fails, too.

Any ideas how I can make this connection would be great.
Thanks for your time.

–Adam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/execnet-dev/attachments/20091118/7834afc0/attachment.pgp>


More information about the execnet-dev mailing list