Package buildbot :: Package schedulers :: Module forcesched :: Class NestedParameter
[frames] | no frames]

Class NestedParameter

source code

   object --+    
            |    
BaseParameter --+
                |
               NestedParameter
Known Subclasses:

A 'parent' parameter for a set of related parameters. This provices a logical grouping for the child parameters.

Typically, the 'fullName' of the child parameters mix in the parent's 'fullName'. This allows for a field to appear multiple times in a form (for example, two codebases each have a 'branch' field).

If the 'name' of the parent is the empty string, then the parent's name does not mix in with the child 'fullName'. This is useful when a field will not appear multiple time in a scheduler but the logical grouping is helpful.

The result of a NestedParameter is typically a dictionary, with the key/value being the name/value of the children.

Instance Methods
 
__init__(self, name, fields, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
setParent(self, parent) source code
 
collectChildProperties(self, kwargs, properties, **kw)
Collapse the child values into a dictionary.
source code
 
updateFromKwargs(self, kwargs, properties, **kw)
By default, the child values will be collapsed into a dictionary.
source code

Inherited from BaseParameter: getFromKwargs, parse_from_arg, parse_from_args

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  type = ['nested']
  fields = None
hash(x)

Inherited from BaseParameter: debug, default, hide, label, multiple, name, parentName, regex, required

Properties

Inherited from BaseParameter: fullName

Inherited from object: __class__

Method Details

__init__(self, name, fields, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • name - the name of the field, used during posting values back to the scheduler. This is not necessarily a UI value, and there may be restrictions on the characters allowed for this value. For example, HTML would require this field to avoid spaces and other punctuation ('-', '.', and '_' allowed)
  • label - (optional) the name of the field, used for UI display.
  • regex - (optional) regex to validate the value with. Not used by all subclasses
Overrides: object.__init__
(inherited documentation)

setParent(self, parent)

source code 
Overrides: BaseParameter.setParent

collectChildProperties(self, kwargs, properties, **kw)

source code 

Collapse the child values into a dictionary. This is intended to be called by child classes to fix up the fullName->name conversions.

updateFromKwargs(self, kwargs, properties, **kw)

source code 

By default, the child values will be collapsed into a dictionary. If the parent is anonymous, this dictionary is the top-level properties.

Overrides: BaseParameter.updateFromKwargs