def load_eggs(entry_point_name):
def _load_eggs(env):<EOL><INDENT>distributions, errors = working_set.find_plugins(<EOL>pkg_resources.Environment()<EOL>)<EOL>for dist in distributions:<EOL><INDENT>if dist not in working_set:<EOL><INDENT>env.log.debug('<STR_LIT>', dist, dist.location)<EOL>working_set.add(dist)<EOL><DEDENT><DEDENT>def _log_error(item, e):<EOL><INDENT>ue = exception_to_unicode(e)<EOL>if isinstance(e, DistributionNotFound):<EOL><INDENT>env.log.debug('<STR_LIT>', item, ue)<EOL><DEDENT>elif isinstance(e, VersionConflict):<EOL><INDENT>env.log.error('<STR_LIT>',<EOL>item, ue)<EOL><DEDENT>elif isinstance(e, UnknownExtra):<EOL><INDENT>env.log.error('<STR_LIT>', item, ue)<EOL><DEDENT>else:<EOL><INDENT>env.log.error('<STR_LIT>', item,<EOL>exception_to_unicode(e, traceback=True))<EOL><DEDENT><DEDENT>for dist, e in errors.iteritems():<EOL><INDENT>_log_error(dist, e)<EOL><DEDENT>for entry in sorted(working_set.iter_entry_points(entry_point_name),<EOL>key=lambda entry: entry.name):<EOL><INDENT>env.log.debug(<EOL>'<STR_LIT>',<EOL>entry.name,<EOL>entry.dist.location<EOL>)<EOL>try:<EOL><INDENT>entry.load(require=True)<EOL><DEDENT>except Exception as exc:<EOL><INDENT>_log_error(entry, exc)<EOL><DEDENT>else:<EOL><INDENT>_enable_plugin(env, entry.module_name)<EOL><DEDENT><DEDENT><DEDENT>return _load_eggs<EOL>
Loader that loads any eggs in `sys.path`.