[Buildbot-devel] TextParameter | StringDownload

David Froger david.froger at inria.fr
Wed Feb 12 08:29:40 UTC 2014


Hi,

I've solved the problem like this:

@properties.renderer
def get_file_str(props):
    textarea_content = props.getProperty('the_file')
    #replaces CRLF newlines and "converts" from ? to Python string
    return str( textarea_content.replace('\r\n','\n') )

s = StringDownload(
    get_file_str,
    slavedest = "created.txt")

David

Quoting David Froger (2014-02-11 19:04:12)
> Hi,
> 
> I'm tring to put the content of a TextParameter to a StringDownload.
> 
> The type of the resulting file created on the slave is 'data':
> 
> $ file create.txt
> created.txt: data
> 
> but I would like to get ASCII text:
> 
> $ file created.txt
> created.txt: ASCII text
> 
> Any idea?  My code look like:
> 
>     s = StringDownload(
>         Interpolate("%(prop:the_file)s\n"),
>         slavedest = "created.txt")
> 
>     factory.addStep(s)
> 
>     force_sched = ForceScheduler(
>         ...
>         properties = [ TextParameter(
>             name='the_file', default='', cols=78, row=50)]
>         ...
>     )
> 
> By the way, would it be worth to have a new parameter : FileParameter, which
> would return something like this? :
> http://werkzeug.pocoo.org/docs/datastructures/#werkzeug.datastructures.FileStorage
> 
> Thanks!
> 
> -- 
> David Froger
> 
> ------------------------------------------------------------------------------
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience.  Start now.
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel




More information about the devel mailing list