Package client :: Package Dock :: Module Holders :: Class GenericGroupHolder
[hide private]
[frames] | no frames]

Class GenericGroupHolder

source code

Instance Methods [hide private]
 
__init__(self, bridge, parent, name, inputs, inputOrder, outputs) source code
 
setEnabled(self, enable)
This method allows you to switch make the group's parent holder usable or unusable.
source code
 
isInFull(self)
This method will return either True or False depending on whether all of the input holders have been filled in.
source code
 
getNumberOfIns(self)
This method will returnthe number of input holders which have a _item member.
source code
 
getInNames(self, careful=True)
GenericGroupHolder.getInNames (self, careful = True)
source code
 
getInAccesses(self, careful=True)
GenericGroupHolder.getInAccesses (self, careful = True)
source code
 
getOutNames(self, careful=True)
GenericGroupHolder.getOutNames (self, careful = True)
source code
 
clear(self)
This is a convenience method which simply calls the clear () method on:
source code
 
PurgeIncorrectChildren(self)
This method will run through all of the input holders and check if their parent item is the current parent item.
source code
Method Details [hide private]

__init__(self, bridge, parent, name, inputs, inputOrder, outputs)
(Constructor)

source code 
Parameters:
  • bridge (Bridge) - The bridge object which connects all interactive components together.
  • parent ([list <string>, list <string>]) - The first list contains strings of valid basin types. The second list contains strings of valid python types. There must be exactly two outter lists, the inner lists may vary from being empty to any number of strings.
  • name () - A string name of the parent
  • inputs ([list <string>, list <string>]) - A dictionary of string names for inputs, to a 2 element list of lists, similar to the type from `parent`
  • inputOrder (list <string>) - A list of string names for inputs. These should correspond to the keys of inputs.
  • outputs (list <string>) - A list of string names for outputs.

setEnabled(self, enable)

source code 

Overview

This method allows you to switch make the group's parent holder usable or unusable. This can be useful when you want to be able to "switch" between a group of holders with a parent, and without.

An example of this is in the AbstractTransform where a checkbox is used to determine if the function's output should be directed to the parent list (in which case we'd want this function to enable the parent holder). Otherwise the function will direct its output to the free variables (in which case we'd want the function to disable the parent holder).

Parameters:
  • enable (boolean

    return: none

    ) - If true, will allow the group's parent holder to be accessable, false if not.

isInFull(self)

source code 

Overview

This method will return either True or False depending on whether all of the input holders have been filled in.

It utilizes getNumberOfIns and compares it to the length of self._inputHolders.

Returns:
boolean, whether or not all of the input holders have been filled

getNumberOfIns(self)

source code 

Overview

This method will returnthe number of input holders which have a _item member. The method does not take in to account the total number of holders.

Returns:
integer, the number of items found in the input holders

getInNames(self, careful=True)

source code 

GenericGroupHolder.getInNames (self, careful = True)

This method will generalls return a list of the names on items in the input holders.

If careful is True, then it will return False if it ever encounters an empty holder. It defaults to this.

If careful is False, then it will always return a list of strings, and if an input holder has no _item member, then it won't append anything to the result list.

getInAccesses(self, careful=True)

source code 

GenericGroupHolder.getInAccesses (self, careful = True)

This method will generalls return a list of the ipython shell access strings on items in the input holders.

If careful is True, then it will return False if it ever encounters an empty holder. It defaults to this.

If careful is False, then it will always return a list of strings, and if an input holder has no _item member, then it won't append anything to the result list.

getOutNames(self, careful=True)

source code 

GenericGroupHolder.getOutNames (self, careful = True)

This method will generalls return a list of the names on items in the output holders.

If careful is True, then it will return False if it ever encounters an empty holder. It defaults to this.

If careful is False, then it will always return a list of strings, and if an output holder has no _item member, then it won't append anything to the result list.

clear(self)

source code 

Overview

This is a convenience method which simply calls the clear () method on:

  1. self._parent
  2. all holders in self._inputHolders
  3. all holders in self._outputHolders

return: none

PurgeIncorrectChildren(self)

source code 

Overview

This method will run through all of the input holders and check if their parent item is the current parent item. If any of the input holders don't meet that condition, then their clear method is called individually, effectively purging it from the group.

return: none