Could Bots support sftp?

180 views
Skip to first unread message

BikeMike

unread,
Oct 15, 2010, 1:08:38 AM10/15/10
to Bots Open Source EDI Translator
follow on from
http://groups.google.com/group/botsmail/browse_thread/thread/17be99415a5620e8/91e1f0262d5f2b16?lnk=gst&q=sftp#91e1f0262d5f2b16
(can't post to old threads?)

This issue has raised it's head again for me. Now I see in Bots 2.0
there is ftps, but not sftp? Any more pointers where to start... I
guess I need to use paramiko.

BikeMike

unread,
Oct 15, 2010, 2:06:29 AM10/15/10
to Bots Open Source EDI Translator
I have installed paramiko and pycrypto. The demo_sftp.py included
works with the server I want to connect :-)

I want to try including it in communication.py as a standard Bots
option, not a communication script. So I have made a start copying
class ftps to class sftp, and adding sftp to models.py. Not really
sure how I'll go from here, but with trial-and-error maybe I can make
something work!

BikeMike

unread,
Oct 15, 2010, 9:15:33 AM10/15/10
to Bots Open Source EDI Translator
I have connect and incommunicate working :-)

Bots will log on to the sftp server and get my files. Just need to do
outcommunicate (even though I don't actually need it). You were right,
not that difficult after all.
When done I will send it for inclusion in the next version.

Kind regards,
Mike

henk-jan ebbers

unread,
Oct 15, 2010, 6:13:59 PM10/15/10
to bots...@googlegroups.com
hi Mike,

that is great!

henk-jan

BikeMike

unread,
Oct 16, 2010, 8:50:40 AM10/16/10
to bots...@googlegroups.com
Well here it is :-)

I have tested in both directions, ascii/binary files (sftp is only
binary), append mode, create new dirs, logging... hope I didn't miss
anything, all seems to work ok for me.

Kind Regards,
Mike

sftp mod.zip
Message has been deleted
Message has been deleted

BikeMike

unread,
Oct 18, 2010, 10:49:55 PM10/18/10
to bots...@googlegroups.com
Update: added default port (22)
sftp mod.zip

BikeMike

unread,
Jan 25, 2011, 4:08:48 AM1/25/11
to bots...@googlegroups.com
A few small changes, checking for dependencies (paramiko and pycrypto)
and sorting CHANNELTYPE and EDITYPES alphabetically.

Kind Regards,
Mike

MOD - sftp communication.zip

henk-jan ebbers

unread,
Feb 28, 2011, 7:33:06 AM2/28/11
to bots...@googlegroups.com
hi Mike,

added this.
did not test this as I am still setting up tests for this.

about the sorting of communicationtypes and editypes: I am still looking at this.
on one had: sorting a a good and clear way.
OTOH: some entries are (I think) sendom used.
I guess it is better to use the sorted way...just have to get used to it ;-))

henk-jan

Reply all
Reply to author
Forward
0 new messages