def get_idx(klass, path): if path in klass._cdb_cache: idx = klass._cdb_cache[path] else: idx = cdb.init(path) klass._cdb_cache[path] = idx return idx
def open(self): if not self.cdb: self.cdb = cdb.init(self.fname) (self.ndocs, self.nterms) = idx_info(self.cdb) return
def open(self, mode='r'): import pycdb as cdb self._db = cdb.init(self.dbfile) return