dpservis / bots

Automatically exported from code.google.com/p/bots
0 stars 0 forks source link

add: utility function to limit lengths for outgoing fields #137

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
usage:
        out.put({'BOTSID':'XXX','Field':transform.limitlength(inn.get({'BOTSID':'YYY', 'Field':None}),30)})

Original issue reported on code.google.com by hjebb...@gmail.com on 18 May 2012 at 1:02

GoogleCodeExporter commented 8 years ago
Yes. An almost exact copy of a function I created for myself, but mine is 
called truncate, and the length parameter comes first. I think that makes the 
code a bit more readable but perhaps is not the "expected" way.

# truncate to 30 characters
out.put({'BOTSID':'XXX','Field':truncate(30,inn.get({'BOTSID':'YYY', 
'Field':None}))})

Original comment by mjg1964 on 19 May 2012 at 10:17

GoogleCodeExporter commented 8 years ago
hahaha,
I will change it to your function. ;-))

Original comment by hjebb...@gmail.com on 19 May 2012 at 10:55

GoogleCodeExporter commented 8 years ago

Original comment by hjebb...@gmail.com on 10 Sep 2013 at 12:45