Trying to use Vim for remote editing with Zope
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
Jean Jordaan wrote:
Hi all
I tried out Vim 6 with the 'netrw.vim' plugin to edit files remotely.
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?
Are you sure you just don't have a syntax error in your python code? That would raise a error like this. Since FTP is pretty inflexible, it can't *tell* you exactly that. Editing python scripts with Emacs over FTP works fine, BTW (I had to...good thing I removed the cross-post to vim-dev!) -Michel
Hi Michel Thanks for the answer :)
Are you sure you just don't have a syntax error in your python code?
Pretty much, yes -- all I did was to add "testing vim" to the docstring of an existing, working method. Something I have seen, is that Vim comes up showing ^M characters (literal newlines) at the line ends of the Parameters comment block, but not in the body of the document. I thought that this might confuse ftp ASCII mode ..
Editing python scripts with Emacs over FTP works fine, BTW
Yes, I've done that too! <gripe><moan> Unfortunately I don't have years of Emacs experience, and though I truly long to use it, I find it an absolute Beast. Just changing the default font at startup has me stumped. I've asked on the emacs newsgroups, and got one or two obscure answers which led to default-frame-alist, which the emacs docs said was obsolete (changed to default-frame-plist) without documenting using it to specify fonts. I also found a bunch of threads about people flaming RedHat for mal-customizing the Emacs they distribute, and contributing long slews of elisp to unbreak things like M-x apropos, which makes me feel way out of my depth. I wouldn't even know if things were broken. That's absolutely typical for my Emacs experience. I've yet to get IMAP support for Gnus installed, too. </moan></gripe> Regards, Jean
Michel Pelletier writes:
Jean Jordaan wrote:
I tried out Vim 6 with the 'netrw.vim' plugin to edit files remotely.
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?
Are you sure you just don't have a syntax error in your python code? That would raise a error like this. Since FTP is pretty inflexible, it can't *tell* you exactly that. I remember someone patched Zope's FTP support to provide better error messages.
Search the searchable mailing list archives... Dieter
Hi Dieter
Search the searchable mailing list archives...
I tried, but Zope-Dev ("ftp patch") .. http://zope.nipltd.com/public/lists/dev-archive.nsf/Main?SearchView=&Start=1 &Count=20&SearchOrder=1&ExactMatch=&SearchOrder=1&Query=ftp+patch .. gives me zero hits. On Zope (same search) .. http://zope.nipltd.com/public/lists/zope-archive.nsf/Main?SearchView=&Query= ftp+patch&SearchOrder=1&Start=1&Count=20 .. I get one hit, to a patch of yours which fixes FTP for mirroring folders: http://zope.nipltd.com/public/lists/zope-archive.nsf/47ba74c812dbc5dd8025687 f0024bb5f/39cab72986543b5480256a870078abbe?OpenDocument Searching for "ftp server" at Zope-Dev yielded 48 hits, I'm working thru them but haven't got lucky yet. Regards, Jean Jordaan
Hello all, has anyone encountered any difficulty using the Tutorial with Python 2.x?? If anyone out there is using Python 2.x, can you quickly try a new tutorial and tell me if the links work properly? Thanks, John
Jean Jordaan writes:
Search the searchable mailing list archives...
I tried, but Zope-Dev ("ftp patch") .. Subject: [Zope-dev] FTP error messages From: <richard@bizarsoftware.com.au> To: zope-dev@zope.org <zope-dev@zope.org> Date: Wed, 21 Feb 2001 13:12:12 +1100
Dieter
participants (4)
-
Dieter Maurer -
Jean Jordaan -
John Ziniti -
Michel Pelletier