예제 #1
0
 def clear_cache(self):
     """ Clears the caches used (flushing any data not yet
         written).
     """
     if self.caching:
         #self.flush()
         Tools.method_mapply(self.caches, 'clear', ())
예제 #2
0
    def clear_cache(self):

        """ Clears the caches used (flushing any data not yet
            written).
        """
        if self.caching:
            #self.flush()
            Tools.method_mapply(self.caches,'clear',())
예제 #3
0
    def free(self, position, OLD=OLD, HOT=HOT):
        """ Deletes an already written record by marking it OLD.

            The next garbage collection will make the change permanent
            and free the occupied space.

        """
        if self.state != HOT:
            self.mark(HOT)
        file = self.file
        file.seek(position + 5)
        file.write(OLD)

        if self.caching:
            Tools.method_mapply(self.caches, 'delete', (position, ))
예제 #4
0
    def free(self,position,

             OLD=OLD,HOT=HOT):

        """ Deletes an already written record by marking it OLD.

            The next garbage collection will make the change permanent
            and free the occupied space.

        """
        if self.state != HOT:
            self.mark(HOT)
        file = self.file
        file.seek(position + 5)
        file.write(OLD)

        if self.caching:
            Tools.method_mapply(self.caches,'delete',(position,))