#include <eh.py.h>
Inheritance diagram for eh.ItemContainer:
An item container allows common operations such as setting/getting attributes and calling functions to be performed across a list of objects.
Public Member Functions | |
__init__ (items) | |
Constructor. | |
__call__ (args, kwds) | |
Where GetValues() returns a list of callable objects will call all those objects with *args and **kwds placing the results for each call into a list that is returned as a new ItemListContainer. | |
__getattr__ (key) | |
Returns a ItemListContainer containing the attribute named "key" from all objects in GetValues(). | |
__setattr__ (key, value) | |
If all managed objects have am attribute named "key" will set the value of all the objects "key" attribute, otherwise will bind a new attribute named "key" to this object. | |
__len__ () | |
Returns the number of items managed by this container. | |
__iter__ () | |
Returns an iterator that can be used to iterate over this container. | |
Matches (callback, match_str, mtype=Regexp, inverse=False, container_type=None) | |
Performs a generic match of values managed by this container returning a new instance of this container type with the subset of items that successfully matched. | |
MatchesInList (callback, data_list) | |
Performs an exact match on all strings in data_list against GetValues() returning the result in a new container. | |
MatchesIn (callback, data_list) | |
Performs an exact match on all strings in data_list against GetValues() returning the result in a new container. | |
GetValues () | |
Abstract method used by the ItemContainer to obtain a list of values that it manages. |
eh.ItemContainer.__init__ | ( | items | ) |
eh.ItemContainer.__call__ | ( | args | , | |
kwds | ||||
) |
Where GetValues() returns a list of callable objects will call all those objects with *args and **kwds placing the results for each call into a list that is returned as a new ItemListContainer.
eh.ItemContainer.__getattr__ | ( | key | ) |
Returns a ItemListContainer containing the attribute named "key" from all objects in GetValues().
This will return all attributes from the managed objects, including functions which can then be called using the __call__() method on the resulting ItemListContainer object.
eh.ItemContainer.__setattr__ | ( | key | , | |
value | ||||
) |
If all managed objects have am attribute named "key" will set the value of all the objects "key" attribute, otherwise will bind a new attribute named "key" to this object.
eh.ItemContainer.__len__ | ( | ) |
Returns the number of items managed by this container.
eh.ItemContainer.__iter__ | ( | ) |
Returns an iterator that can be used to iterate over this container.
eh.ItemContainer.Matches | ( | callback | , | |
match_str | , | |||
mtype | = Regexp , |
|||
inverse | = False , |
|||
container_type | = None | |||
) |
Performs a generic match of values managed by this container returning a new instance of this container type with the subset of items that successfully matched.
This will perform a generic match on items in GetValues() using one of the match types: Exact(), Contains() or Regexp().
eh.ItemContainer.MatchesInList | ( | callback | , | |
data_list | ||||
) |
Performs an exact match on all strings in data_list against GetValues() returning the result in a new container.
The resulting container will contain all items managed by the current container that match the strings in data_list.
eh.ItemContainer.MatchesIn | ( | callback | , | |
data_list | ||||
) |
Performs an exact match on all strings in data_list against GetValues() returning the result in a new container.
The resulting container will contain all items managed by the current container that match the strings in data_list.
eh.ItemContainer.GetValues | ( | ) |
Abstract method used by the ItemContainer to obtain a list of values that it manages.
Reimplemented in eh.ItemListContainer, and eh.ItemMapContainer.