#NEWLINE# def invalidate_objects_cf( self ) : #NEWLINE# #INDENT# '\n        Split the invalidation request in groups of 1000 objects\n        ' #NEWLINE# if ( not self . AWS_CLOUDFRONT_DISTRIBUTION ) : #NEWLINE# #INDENT# raise CommandError ( 'An object invalidation was requested but the variable AWS_CLOUDFRONT_DISTRIBUTION is not present in your settings.' ) #NEWLINE# #UNINDENT# chunk = 1000 #NEWLINE# conn = self . open_cf ( ) #NEWLINE# objs = self . uploaded_files #NEWLINE# chunks = [ objs [ i : ( i + chunk ) ] for i in range ( 0 , len ( objs ) , chunks ) ] #NEWLINE# for paths in chunks : #NEWLINE# #INDENT# conn . create_invalidation_request ( self . AWS_CLOUDFRONT_DISTRIBUTION , paths )