'Outputs the downloaded entities.
This implementation writes CSV.
Args:
entity_generator: A generator that yields the downloaded entities
in key order.'

def output_entities(self, entity_generator):

    CheckOutputFile(self.output_filename)
    output_file = open(self.output_filename, 'w')
    logger.debug('Export    complete,    writing    to    file')
    output_file.writelines((self.__SerializeEntity(entity) for entity in entity_generator))
