Table of Contents

Class: FileIndex Bio/SCOP/FileIndex.py

An in memory index that allows rapid random access into a file.

The class can be used to turn a file into a read-only database.

Base Classes   
UserDict
Methods   
__getitem__
__init__
  __getitem__ 
__getitem__ ( self,  key )

Return an item from the indexed file.

  __init__ 
__init__ (
        self,
        filename,
        iterator_gen,
        key_gen,
        )

Arguments:

filename
The file to index
iterator_gen
A function that eats a file handle, and returns a file iterator. The iterator has a method next() that returns the next item to be indexed from the file.
key_gen
A function that generates an index key from the items created by the iterator.

Table of Contents

This document was automatically generated on Mon Jul 1 12:02:55 2002 by HappyDoc version 2.0.1