How does vim.py from python-vim.sourceforge.net work?

Phlip phlip_cpp at yahoo.com
Fri May 3 18:32:54 EDT 2002


Phlip wrote:

> I'm attempting to perform the Refactor "Replace Documentary Comment With
> Test" on vim.py, and I have gotten this far:

if __name__ == '__main__':

    dpy = display.Display()
    aComWin = commWindow(dpy)
    thing = aComWin.lookup_name('RAD')
    print repr(thing)
    aServer = server(aComWin, 'RAD', thing)
    print aServer.is_still_valid()
    print aServer.valid
    aServer.send('iHello World!<ESC>')

The first problem with my earlier post was I had vim 6.0z. Now that I
have 6.0.19 it supports the servername command:

	gvim --servername RAD 

The python-vim and python-xlib now spew many print statements to the
effect that they found a vim window called RAD, but the gvim itself never
shows the "Hello World" response.

What am I missing? Is there a more inscrutable command to send?

BTW private e-mail revealed to fix the prior error I should just tweak
the code:

          # Split up the result.value by "\0"
        if result is not None:
            r = result.value.split("\0")
        else:
            r = []

Yes, I would have tried that eventually.

-- 
  Phlip
        http://www.greencheese.org/PeaceAndCalm
  --  Set phasers on illin'  --



More information about the Python-list mailing list