bl.OGware

infrequent grumblings of a software engineer and then some… (also some Delphi programming)

FTP Upload Selection macro available.

Posted by tier777 on 2005-10-19

Inspired by a recent thread on the CVSGUI list, I just wrote this little macro:

FtpUpload.py

It allows you to upload any selection of files or folders to a specified folder on an FTP server. Here are the relevant bits from the comment header (take special note of the disclaimers regarding binary file handling!):

WinCvs Macro "Ftp Test"
$Revision: 1.1.2.4 $

written by Oliver Giesen, Oct 2005
contact: 
email:  ogware@...
icq:    18777742
y!:     ogiesen

Feel free to modify or distribute in whichever way you like, 
as long as it doesn't limit my personal rights to modify and
redistribute this code.
Apart from that the code is supplied "as-is", i.e. without warranty of any
kind, either expressed or implied, regarding its quality or security.
Have fun!

ATTENTION:
You will need at least WinCvs 1.3.5 to execute any Python macros
from within WinCvs! This macro has last been tested against WinCvs 2.0.3 .

======
Usage:

- Select one or more files and/or folders

- Run the macro from the Macros menu

- Follow the on-screen instructions

~ The macro will attempt to login to the given host and chdir into the given
destination directory (creating it if necessary). It will then upload the 
selected files and folders. It will recreate the directory structure of
your sandbox, i.e. if you select files from multiple folders with
Flat View turned on, the macro will upload the files to the relative paths
that are displayed in the Path column.

=============
Known Issues / "Un-niceties":

- No auto-detection of binary files to speak of! If files are under
CVS-control and are marked binary, the macro will pick this up but "Unknown"
files are currently always transferred as text.
- I have occasionally noticed corruption of binary files but haven't yet been
able to determine what causes it and how to prevent it.
- No support yet for advanced FTP connection options, like port, proxy,
active mode, etc.
- The password entry is in plain text.
- The password is not remembered (though it would be trivial to add that
functionality). This is actually on purpose for security/privacy reasons
but still a bit annoying in practice.

Please report any problems you may encounter or suggestions you might
have to ogware@... .

Cheers,

Oliver

One Response to “FTP Upload Selection macro available.”

  1. Anonymous said

    Suggestion

    Hi Oliver,

    One of our users discovered this recently. If you are in flat mode and you hightlight a folder, then the directory used by the ftp gets confused. See below for example ( the second CWD ),

    regards

    Mike Gettings

    Logging in…
    230-Last unsuccessful login: Thu Nov 24 11:14:20 GMT 2005 on ftp from vsc-qya5alj1hk3
    230-Last login: Thu Nov 24 12:06:04 GMT 2005 on ftp from vsc-qya5alj1hk3
    230 User mikeg logged in.
    CWD merx/repository/database/DB2Data
    250 CWD command successful.
    STOR .#DataPart12DB2.txt.1.4 (text)
    226 Transfer complete.
    STOR CreateInsertColumnMapping.txt (text)
    226 Transfer complete.
    STOR DataPart10DB2.txt (text)
    226 Transfer complete.
    STOR DataPart11DB2.txt (text)
    226 Transfer complete.
    STOR DataPart12DB2.txt (text)
    226 Transfer complete.
    STOR DataPart13DB2.txt (text)
    226 Transfer complete.
    STOR DataPart1DB2.txt (text)
    226 Transfer complete.
    STOR DataPart2DB2.txt (text)
    226 Transfer complete.
    STOR DataPart3DB2.txt (text)
    226 Transfer complete.
    STOR DataPart4DB2.txt (text)
    226 Transfer complete.
    STOR DataPart5DB2.txt (text)
    226 Transfer complete.
    STOR DataPart6DB2.txt (text)
    226 Transfer complete.
    STOR DataPart7DB2.txt (text)
    226 Transfer complete.
    STOR DataPart8DB2.txt (text)
    226 Transfer complete.
    STOR DataPart9DB2.txt (text)
    226 Transfer complete.
    STOR DataTransform.bat (text)
    226 Transfer complete.
    STOR DataTransformation.java (text)
    226 Transfer complete.
    STOR DeleteTablesList.txt (text)
    226 Transfer complete.
    CWD /u1/people/mikeg/merx/repository/database/DB2Data/DB2Data/Tablelist/Tablelist
    250 CWD command successful.
    STOR TableList10th.txt (text)
    226 Transfer complete.
    STOR TableList11th.txt (text)
    226 Transfer complete.
    STOR TableList12th.txt (text)
    226 Transfer complete.
    STOR TableList13th.txt (text)
    226 Transfer complete.
    STOR TableList1st.txt (text)
    226 Transfer complete.
    STOR TableList2nd.txt (text)
    226 Transfer complete.
    STOR TableList3rd.txt (text)
    226 Transfer complete.
    STOR TableList4th.txt (text)
    226 Transfer complete.
    STOR TableList5th.txt (text)
    226 Transfer complete.
    STOR TableList6th.txt (text)
    226 Transfer complete.
    STOR TableList7h.txt (text)
    226 Transfer complete.
    STOR TableList8th.txt (text)
    226 Transfer complete.
    STOR TableList9th.txt (text)
    226 Transfer complete.
    QUIT
    221 Goodbye.
    Done.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: