Home | Trees | Indices | Help |
|
---|
|
List of dictionaries (or similar objects). Special support is given to access and use entries in the dictionaries for filtering and sorting. Some care is taken to avoid the adding of non-allowed objects (but somehow it is, certainly, still possible).
The list can be sorted and filtered by any dictionary key, values within the dictionaries are easily accessible and can be plotted against each other.
Overriding / Extending: The class is designed to be easily adapted for holding more complex objects. In order to do so, the attribute item_type should be set to the allowed class. All objects with a get( key, default ) and a keys() method should then work out of the box. If the two methods are missing, getItemValue and getItemKeys must be overriden.
|
|||
|
__init__(self,
lst=[],
item_type=dict) x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
||
str
|
version(self) Version of class. |
||
any
|
getItemValue(self,
item,
key,
default=None) Get a value from a given item (dictionary). |
||
[ any ],
|
getItemKeys(self,
item) Get the attribute keys used by a certain item. |
||
any
|
getValue(self,
i,
key,
default=None) Get the value of a dictionary entry of a list item. |
||
|
checkType(self,
v) Make sure v is a dictionary |
||
dict
|
_processNewItem(self,
v,
i=None) Called before an item is added to the list. |
||
list
|
_processNewItems(self,
lst,
indices=None) Called before list of items is added to the list. |
||
|
__setitem__(self,
i,
v) Set value v of position i. |
||
instance
|
__getslice__(self,
i,
j) Return new instance with only the given range of items. |
||
|
extend(self,
lst) Add all items to (the end of) this instance. |
||
|
append(self,
v) Append item to the end of this list. |
||
DictList
|
take(self,
indices) Returns DictList (or sub-class) with specified items |
||
[ any ],
|
keys(self) Returns attribute keys used by the current items. |
||
[ int ]
|
argsortRandom(self) Random sort. |
||
Inherited from Inherited from |
|
|||
Inherited from |
|
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
Version of class.
|
Get a value from a given item (dictionary). Override this method to use the DictList for entries without get() function.
|
Get the attribute keys used by a certain item. Override this method to use the DictList for entries without keys() function.
|
Get the value of a dictionary entry of a list item.
|
Make sure v is a dictionary
|
Called before an item is added to the list. Override but call.
|
Called before list of items is added to the list. For efficiency, the single new items are only processed if lst is not already an instance of this class (DictList by default). Override but call.
|
Set value v of position i. >>> lst[i] = v
|
Return new instance with only the given range of items.
|
Add all items to (the end of) this instance. Use:extend( list ).
|
Append item to the end of this list. Use:append( dict ).
|
|
|
Random sort.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0alpha3 on Tue May 1 22:34:52 2007 | http://epydoc.sourceforge.net |