Package amplee :: Package indexer :: Class BaseIndex
[show private | hide private]
[frames | no frames]

Type BaseIndex

object --+
         |
        BaseIndex

Known Subclasses:
AtomIDIndexer, AuthorIndex, CategoryIndex, DateIndex, KeywordIndex

Method Summary
  __init__(self, name, container)
Base class of your index handler.
  iterindex(self, func)
Iterates through the keys of the container and apply for each one the provided ``func`` with the key and the data associated.
  keys(self)
Return all the existing keys in the container as a list.
  load(self, key)
Returns the value associated with the key as a set of one element.
  store(self, key, value)
Stores a value within the index container
  update(self, member)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Method Details

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

Base class of your index handler.

Built-in index handlers will always inherit from this class but your own handlers don't need to as long as they implement a method named `update` and taking the `member` as its unique parameter.

The ``name`` parameter is an internal identifier.

The ``container`` is an instance of object implementing the dictionnary interface.
Overrides:
__builtin__.object.__init__

iterindex(self, func)

Iterates through the keys of the container and apply for each one the provided ``func`` with the key and the data associated.

If you want to stop the iteration you can simply raise StopIteration from the function.

The method returns a list of results provided by the function calls.

keys(self)

Return all the existing keys in the container as a list. Not all containers support that features and should therefore be used carefully.

load(self, key)

Returns the value associated with the key as a set of one element.

store(self, key, value)

Stores a value within the index container

The ``key`` and ``value`` can be any object as long as the container can cope with it.

Generated by Epydoc 2.1 on Thu Jul 19 15:32:17 2007 http://epydoc.sf.net