'Does file pre-processing if required'

def pre_process(self):

    self.pre_dir = mkdtemp()
    pre_path = os.path.join(self.pre_dir, self.src_filename)
    shutil.copy(self.full_source_path, pre_path)
    logger.debug('Pre-processing:    %s    %s', self.src_name, self.pre_dir)
    self.final_extension = self.run_externals(self.src_extension, pre_path, self.site.external_manager.processors)
    if (not self.discarded):
        _ = self.run_externals(self.final_extension, pre_path, self.site.external_manager.optimizers)
        assert (self.final_extension == _), 'Illegal    Optimizer:    may    not    change    the    extension'
        assert (not self.discarded), 'Illegal    Optimizer:    may    not    discard    files'
    return pre_path
