#NEWLINE# def prune_before( self , timestamp ) : #NEWLINE# #INDENT# 'Remove all resources with timestamp earlier than that given\n        \n        Returns the number of entries removed. Will raise an excpetion\n        if there are any entries without a timestamp.\n        ' #NEWLINE# n = 0 #NEWLINE# pruned = [ ] #NEWLINE# for r in self . resources : #NEWLINE# #INDENT# if ( r . timestamp is None ) : #NEWLINE# #INDENT# raise Exception ( ( 'Entry %s has no timestamp' % r . uri ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( r . timestamp >= timestamp ) : #NEWLINE# #INDENT# pruned . append ( r ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# n += 1 #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . resources = pruned #NEWLINE# return n