Feature requests

25 views
Skip to first unread message

David

unread,
May 9, 2013, 10:14:51 AM5/9/13
to bots...@googlegroups.com
Hi,

I've just implemented Bots and had a couple of things that I had to change and IMO would be good features.

1) Temp file on ftp transfer. Upload to a temporary file and then rename on success, I modified communications.py to do this for us but that's somewhat of a bodge as it doesn't create the option and does it globally.
2) Select part of the (incoming) filename as the outname. Eg it would be nice if you had a incoming file of INV_123456.INV to having something like {infile:5-10} which could select chars 5-10 (ie in this case 123456). Obviously can do this via a communication script but would be nice not to have to.
3) Archiving for FTP. Would be nice to be able to do a remote move on the ftp server rather than archive locally. I didn't bother working round this.

Regards

David

henk-jan ebbers

unread,
May 9, 2013, 2:45:43 PM5/9/13
to bots...@googlegroups.com

On 05/09/2013 04:14 PM, David wrote:
> Hi,
>
> I've just implemented Bots and had a couple of things that I had to change and IMO would be good features.
>
> 2) Select part of the (incoming) filename as the outname. Eg it would be nice if you had a incoming file of INV_123456.INV to having something like {infile:5-10} which could select chars 5-10 (ie in
> this case 123456). Obviously can do this via a communication script but would be nice not to have to.
basic functionality is from this: http://docs.python.org/2/library/string.html#formatstrings
but can it do that? no, see: http://stackoverflow.com/questions/14072810/slicing-strings-in-str-format

but there I found this one: {infile[2]}{infile[3]}{infile[4]}{infile[5]}{infile[6]}_*.xml
tested that one - it works!
amazing!
(but seems there is no checking if you try to access wrong string position)

other thing is that {infile:name} would give 'INV_123456' (only the name)

maybe that helps; but there is a special formatting routine for infile ( class infilestr(str) in communication.py); so feel free to add this. It is welcome!


> 1) Temp file on ftp transfer. Upload to a temporary file and then rename on success, I modified communications.py to do this for us but that's somewhat of a bodge as it doesn't create the option and
> does it globally.
> 3) Archiving for FTP. Would be nice to be able to do a remote move on the ftp server rather than archive locally. I didn't bother working round this.
both are quite specific, but I have met these indeed.

both could be done by sub-classing communication method.
will check if this could be done easier (some pre/post options in ftp-communication)

problem I see her is that there are a lot of variant for ftp.
if all these variants would be in bots, this would lead to a lot of parameter (be be un-understandable....)
that is why I am thinking of easier-to-use user scrpting


thank you!!!

henk-jan

>
> Regards
>
> David
> --
> You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

BikeMike

unread,
Jun 10, 2013, 9:51:08 PM6/10/13
to bots...@googlegroups.com
> 2) Select part of the (incoming) filename as the outname. Eg it would be nice if you had a incoming file of INV_123456.INV to having something like {infile:5-10} which could select chars 5-10 (ie in
> this case 123456). Obviously can do this via a communication script but would be nice not to have to.
basic functionality is from this: http://docs.python.org/2/library/string.html#formatstrings
but can it do that? no, see: http://stackoverflow.com/questions/14072810/slicing-strings-in-str-format

but there I found this one: {infile[2]}{infile[3]}{infile[4]}{infile[5]}{infile[6]}_*.xml
tested that one - it works!
amazing!
(but seems there is no checking if you try to access wrong string position)

Added this example to the wiki.
http://code.google.com/p/bots/wiki/Filenames

Kind Regards,
Mike
Reply all
Reply to author
Forward
0 new messages