#NEWLINE# def close_spider( self , spider ) : #NEWLINE# #INDENT# ' Method called when the spider is closed\n\n        :type spider: BaseSpider object\n        :param spider: The spider running the queries\n        :returns: None\n        ' #NEWLINE# if self . item_buffer : #NEWLINE# #INDENT# self . insert_item ( self . item_buffer , self )