'Parse and execute the prebuild_script from the zappa_settings.'

def execute_prebuild_script(self):

    (pb_mod_path, pb_func) = self.prebuild_script.rsplit(u'.', 1)
    try:
        if (pb_mod_path.count(u'.') >= 1):
            (mod_folder_path, mod_name) = pb_mod_path.rsplit(u'.', 1)
            mod_folder_path_fragments = mod_folder_path.split(u'.')
            working_dir = os.path.join(os.getcwd(), *mod_folder_path_fragments)
        else:
            mod_name = pb_mod_path
            working_dir = os.getcwd()
        working_dir_importer = pkgutil.get_importer(working_dir)
        module_ = working_dir_importer.find_module(mod_name).load_module(mod_name)
    except (ImportError, AttributeError):
        try:
            module_ = importlib.import_module(pb_mod_path)
        except ImportError:
            raise ClickException((((click.style(u'Failed    ', fg=u'red') + u'to    ') + click.style(u'import    prebuild    script    ', bold=True)) + u'module:    "{pb_mod_path}"'.format(pb_mod_path=click.style(pb_mod_path, bold=True))))
    if (not hasattr(module_, pb_func)):
        raise ClickException(((((click.style(u'Failed    ', fg=u'red') + u'to    ') + click.style(u'find    prebuild    script    ', bold=True)) + u'function:    "{pb_func}"    '.format(pb_func=click.style(pb_func, bold=True))) + u'in    module    "{pb_mod_path}"'.format(pb_mod_path=pb_mod_path)))
    prebuild_function = getattr(module_, pb_func)
    prebuild_function()
