/usr/lib/python2.6/site-packages/openstackclient/api
Edit: /usr/lib/python2.6/site-packages/openstackclient/api/utils.pyc (2054B)
Ñò
;vVc @ s d Z d d d d d „ Z d S( s API Utilities Libraryc C sö | p | p
| d j o | SxÍ t | ƒ D]¿ } | | j o | | } n_ | oQ | | j oD t | | ƒ t j o- | | | j o | | | } q® d } n d } | p
| | j o+ y | i | ƒ Wqî t j
o qî Xq/ q/ W| S( sÓ Filter a list of dicts
:param list data:
The list to be filtered. The list is modified in-place and will
be changed if any filtering occurs.
:param string attr:
The name of the attribute to filter. If attr does not exist no
match will succeed and no rows will be retrurned. If attr is
None no filtering will be performed and all rows will be returned.
:param sring value:
The value to filter. None is considered to be a 'no filter' value.
'' matches agains a Python empty string.
:param string property_field:
The name of the data field containing a property dict to filter.
If property_field is None, attr is a field name. If property_field
is not None, attr is a property key name inside the named property
field.
:returns:
Returns the filtered list
:rtype list:
This simple filter (one attribute, one exact-match value) searches a
list of dicts to select items. It first searches the item dict for a
matching ``attr`` then does an exact-match on the ``value``. If
``property_field`` is given, it will look inside that field (if it
exists and is a dict) for a matching ``value``.
N( t Nonet reversedt typet dictt removet
ValueError( t datat attrt valuet property_fieldt dt search_value( ( sI /tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/utils.pyt
simple_filter s$ $
N( t __doc__R R ( ( ( sI /tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/api/utils.pyt
s