Ticket #87: runner.py.diff

File runner.py.diff, 1.3 kB (added by rochg, 1 year ago)

Interpret command line custom properties in TryOptions?

  • /Users/rochg/porting/buildbot-0.7.4/buildbot/scripts/runner.py

    old new  
    611611 
    612612        ["builder", "b", None, 
    613613         "Run the trial build on this Builder. Can be used multiple times."], 
     614        ["customproperties", None, None, 
     615         "A set of custom properties made available in the build environment, format:prop=value,propb=valueb..."], 
    614616        ] 
    615617 
    616618    optFlags = [ 
     
    620622    def __init__(self): 
    621623        super(TryOptions, self).__init__() 
    622624        self['builders'] = [] 
     625        self['custom_props'] = {} 
    623626 
    624627    def opt_builder(self, option): 
    625628        self['builders'].append(option) 
    626629 
     630    def opt_customproperties(self, option): 
     631        # We need to split the value of this option into a dictionary of custom 
     632        # properties 
     633        custom_props = {} 
     634        propertylist = option.split(",") 
     635        for i in range(0,len(propertylist)): 
     636            print propertylist[i] 
     637            splitproperty = propertylist[i].split("=") 
     638            custom_props[splitproperty[0]] = splitproperty[1] 
     639        self['custom_props'] = custom_props 
     640 
    627641    def getSynopsis(self): 
    628642        return "Usage:    buildbot try [options]" 
    629643