[Twisted-Python] How do I upload files using FTPClient?

Andrew Bennetts andrew-twisted at puzzling.org
Mon Jan 6 23:05:15 EST 2003


On Mon, Jan 06, 2003 at 07:47:48PM -0800,  Daniel Burr wrote:
> On Tue, 7 Jan 2003 10:37:22, Andrew Bennetts wrote:
> 
> >Yes, that's my fault.  I haven't gotten around to
> >that yet -- I might have a
> >stab at it tonight, it shouldn't actually be that
> >hard.  I'll try to make sure
> >I get this done in time for the 1.0.2 release.
> 
> That'd be great; I'm interested to see how you do it, as I don't yet fully
> understand the Twisted way.  I have always used Python's ftplib, so doing this
> in a fully async manner is still a little mind-bending for me.

The FTPClient isn't the prettiest code in Twisted, but it's alot better than
it used to be ;)

The key to understanding Twisted is really Deferreds, I think.  Once you
understand those, the rest starts to fall in place nicely.

> >Let me know if there are any other FTP commands
> >you want implemented -- I've
> >also got MDTM on my todo list, which should be
> >trivial (in fact, the
> >apt-proxy guys have already implemented it! :).
> 
> Well, since you asked, I could really use MKD and RMD too, since I am copying
> a directory hierarchy from one server to another, and the target server may
> not already have the correct directory layout.

Ah!  Good idea.

> >The server is desperately in need of a
> >rewrite/refactoring to
> >use twisted.web (so that you can have dynamic
> >resources, and the like).
> >This is on my longer-term todo list...
> >
> >-Andrew.
> 
> That sounds pretty cool, although I'll be perfectly happy if FTPClient can
> reproduce the current functionality of ftplib.

Well, I'm more inclined to spend time on adding a feature if I know
someone wants to/would use it, so keep pestering me :)

> On a semi-related note, I'm thinking about trying to write a Protocol/Factory
> to handle the SCC protocol used by PVCS, SourceSafe, and a few other
> commercial source control tools.  I'm thinking in terms of a Twisted.vcs
> plugin.  Is this a good idea, or is this really not what Twisted is best used
> for?

That sounds reasonable to me.  I know at least one of the Twisted developers
is keen to have WebDAV support, so that they can run Subversion without
Apache.

-Andrew.





More information about the Twisted-Python mailing list