def import_controller(string):
<EOL>scheme, sep, controller = string.partition('<STR_LIT::>')<EOL>if sep != '<STR_LIT::>':<EOL><INDENT>raise ImportError("<STR_LIT>" % string)<EOL><DEDENT>for ep in pkg_resources.iter_entry_points('<STR_LIT>', scheme):<EOL><INDENT>try:<EOL><INDENT>loader = ep.load()<EOL>break<EOL><DEDENT>except (ImportError, pkg_resources.UnknownExtra):<EOL><INDENT>continue<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ImportError("<STR_LIT>" % scheme)<EOL><DEDENT>return loader(controller)<EOL>
Imports the requested controller.  Controllers are specified in a
URI-like manner; the scheme is looked up using the entry point
group "appathy.loader".  Appathy supports the "call:" and "egg:"
schemes by default.