Peach :: group :: GroupSequence :: Class GroupSequence
[hide private]

Class GroupSequence

source code



A sequence of groups.  Each group will be iterated until they are 
completed in sequence.

This is also a container type and can be used as such to gain
access to the contained groups.

HINT: If groups param is an integer it will create an array of
      Group() objects of that length that can be accessed using
      the array specifier groupSequence[x].

Instance Methods [hide private]
 
__init__(self, groups=None, name=None)
Create a GroupSequence object.
source code
Group
getNextGroup(self)
This is a function for slackers that allows access to the next group without having to specify an index.
source code
Group
addNewGroup(self, newGroup=None)
Will add a new Group to sequence of groups and then return that group.
source code
Group
append(self, group=None)
Append a Group.
source code
 
remove(self, group)
Remove a Group.
source code
 
next(self)
Iterate all Generators to next value.
source code
 
reset(self)
Resets all Generators to there initial state.
source code
 
__len__(self) source code
 
__getitem__(self, key) source code
 
__setitem__(self, key, value) source code
 
__delitem__(self, key) source code
 
__iter__(self) source code
 
__contains__(self, item) source code

Inherited from Group: addGenerator, addGenerators, getAllGenerators, getName, removeGenerator, setName

Class Variables [hide private]

Inherited from Group (private): _generators, _identity, _name

Method Details [hide private]

__init__(self, groups=None, name=None)
(Constructor)

source code 

Create a GroupSequence object.

Parameters:
  • groups (list) - Optional list of Groups to use
Overrides: Group.__init__

getNextGroup(self)

source code 

This is a function for slackers that allows access to the next group without having to specify an index.

Returns: Group
Returns the next Group in the list

addNewGroup(self, newGroup=None)

source code 

Will add a new Group to sequence of groups and then return that group.

Parameters:
  • newGroup (Group) - [optional] Group to append, or if not given add Group()
Returns: Group
Returns appended Group

append(self, group=None)

source code 

Append a Group.

Parameters:
  • group (Group) - Group to append
Returns: Group
Returns appended Group

remove(self, group)

source code 

Remove a Group.

Parameters:
  • group (Group) - Group to remove

next(self)

source code 

Iterate all Generators to next value.

From Python docs on next():

The intention of the protocol is that once an iterator's next() method raises StopIteration, it will continue to do so on subsequent calls. Implementations that do not obey this property are deemed broken. (This constraint was added in Python 2.3; in Python 2.2, various iterators are broken according to this rule.)

For Groups, please use the GroupCompleted exception instead of StopIteration (its a subclass).

Overrides: Group.next
(inherited documentation)

reset(self)

source code 

Resets all Generators to there initial state.

Overrides: Group.reset
(inherited documentation)

__iter__(self)

source code 
Overrides: Group.__iter__