[Zope] Trying to use Vim for remote editing with Zope

Jean Jordaan jean@upfrontsystems.co.za
Tue, 17 Jul 2001 15:24:06 +0200


Hi all

I tried out Vim 6 with the 'netrw.vim' plugin to edit files
remotely.

It works beautifully for editing via ftp, but I did hit a
snag .. I want to use it for editing Zope objects. Zope
supports this via both ftp and WebDAV. (To support WebDAV
from Vim, maybe the 'cadaver' commandline WebDAV client
would be useful http://www.webdav.org/cadaver/ ).

Anyway, so I do:

  :e ftp://blommie:10021/standard_html_header

edit a document, and save successfully. This is the trace of the
successful save in my log:

192.168.3.44357 ==> 220 blommie FTP server (Medusa Async V1.13
[experimental]) ready.
192.168.3.44357 <== USER jean
192.168.3.44357 ==> 331 Password required.
192.168.3.44357 <== PASS <password>
192.168.3.44357 ==> 230 Login successful.
192.168.3.44357 <== TYPE A
192.168.3.44357 ==> 200 Type set to ASCII.
192.168.3.44357 <== PORT 192,168,3,4,17,6
192.168.3.44357 ==> 200 PORT command successful.
192.168.3.44357 <== STOR standard_html_header
192.168.3.44357 ==> 150 Opening ASCII connection for standard_html_header
192.168.3.44357 ==> 226 Transfer complete.
192.168.3.44357 <== QUIT
192.168.3.44357 ==> 221 Goodbye.

Then I try to edit a Python script, which is handled a bit
differently by Zope: the file returned by ftp starts with a
magic comment block which contains the script properties. This
is parsed by Zope upon upload. However, this should all be
transparent from the ftp point of view. Unfortunately this is
not the case:

192.168.3.44395 ==> 220 blommie FTP server (Medusa Async V1.13
[experimental]) ready.
192.168.3.44395 <== USER jean
192.168.3.44395 ==> 331 Password required.
192.168.3.44395 <== PASS <password>
192.168.3.44395 ==> 230 Login successful.
192.168.3.44395 <== TYPE A
192.168.3.44395 ==> 200 Type set to ASCII.
192.168.3.44395 <== PORT 192,168,3,4,17,44
192.168.3.44395 ==> 200 PORT command successful.
192.168.3.44395 <== STOR feko_usa/interface/findUser
192.168.3.44395 ==> 150 Opening ASCII connection for
feko_usa/interface/findUser
192.168.3.44395 ==> 426 Error creating file.
192.168.3.44395 <== QUIT
192.168.3.44395 ==> 221 Goodbye.

I've also tried (successfully, in the end) with this Vim/Python
combination:
  http://www.zope.org/Members/zxc/vimFTPExplorer
which is based on:
  http://www.freespeech.org/aziz/vim/
which is included in the Vim 6 distribution.

In that case, the fix was to change from ASCII-mode transfer to
Binary, but that happened in Python:

[jean@blommie vim]$ diff ftpExplorer.vim patched-ftpExplorer.vim
144a145,146
>         bufname=vim.current.buffer.name
>         vim.command('echo "Current buffer: %s"' %bufname)
158c160
<             ftp.storlines('stor %s' %filename, fi)
---
>             ftp.storbinary('stor %s' %filename, fi, 8192)

I did change 'netrw.vim' to transfer in binary mode, but
it didn't help:

192.168.3.44399 ==> 220 blommie FTP server (Medusa Async V1.13
[experimental]) ready.
192.168.3.44399 <== USER jean
192.168.3.44399 ==> 331 Password required.
192.168.3.44399 <== PASS <password>
192.168.3.44399 ==> 230 Login successful.
192.168.3.44399 <== TYPE I
192.168.3.44399 ==> 200 Type set to Binary.
192.168.3.44399 <== PORT 192,168,3,4,17,48
192.168.3.44399 ==> 200 PORT command successful.
192.168.3.44399 <== STOR feko_usa/interface/findUser
192.168.3.44399 ==> 150 Opening Binary connection for
feko_usa/interface/findUser
192.168.3.44399 ==> 426 Error creating file.
192.168.3.44399 <== QUIT
192.168.3.44399 ==> 221 Goodbye.

Any clues as to how to make everything work?

Any chance of making 'explorer.vim' and 'netrw.vim' work
transparently together?

Regards,
Jean