def _read_and_renumber_run(self, path, offset): # Note that SortingPool._read_run() automatically deletes the run file # when it's finished gen = SortingPool._read_run(path) # If offset is 0, just return the items unchanged if not offset: return gen else: # Otherwise, add the offset to each docnum return ((fname, text, docnum + offset, weight, value) for fname, text, docnum, weight, value in gen)
def __init__(self, limitmb=128, **kwargs): SortingPool.__init__(self, **kwargs) self.limit = limitmb * 1024 * 1024 self.currentsize = 0
def save(self): SortingPool.save(self) self.currentsize = 0