'Search for UI controllers in `package_name` and add
them to the webapp.'

def add_ui_controllers(self, package_name, app):

    from galaxy.web.base.controller import BaseUIController
    from galaxy.web.base.controller import ControllerUnavailable
    package = import_module(package_name)
    controller_dir = package.__path__[0]
    for fname in os.listdir(controller_dir):
        if ((not fname.startswith('_')) and fname.endswith('.py')):
            name = fname[:(-3)]
            module_name = ((package_name + '.') + name)
            try:
                module = import_module(module_name)
            except ControllerUnavailable as exc:
                log.debug(('%s    could    not    be    loaded:    %s' % (module_name, str(exc))))
                continue
            for key in dir(module):
                T = getattr(module, key)
                if (inspect.isclass(T) and (T is not BaseUIController) and issubclass(T, BaseUIController)):
                    controller = self._instantiate_controller(T, app)
                    self.add_ui_controller(name, controller)
