Load administration interface from entry point group.

        :param str entry_point_group: Name of the entry point group.
324095
def load_entry_point_group(self, entry_point_group):
        
        for ep in pkg_resources.iter_entry_points(group=entry_point_group):
            admin_ep = dict(ep.load())
            keys = tuple(
                k in admin_ep for k in ('model', 'modelview', 'view_class'))

            if keys == (False, False, True):
                self.register_view(
                    admin_ep.pop('view_class'),
                    *admin_ep.pop('args', []),
                    **admin_ep.pop('kwargs', {})
                )
            elif keys == (True, True, False):
                warnings.warn(
                    'Usage of model and modelview kwargs are deprecated in '
                    'favor of view_class, args and kwargs.',
                    PendingDeprecationWarning
                )
                self.register_view(
                    admin_ep.pop('modelview'),
                    admin_ep.pop('model'),
                    admin_ep.pop('session', db.session),
                    **admin_ep
                )
            else:
                raise Exception(
                    'Admin entry point dictionary must contain '
                    'either "view_class" OR "model" and "modelview" keys.')
1170406
def set_entry_points(self, names):
        
        names = util.return_set(names)
        self.entry_point_names = names
1014828
def load_simple_endpoint(category, name):
    ''''''
    for ep in pkg_resources.iter_entry_points(category):
        if ep.name == name:
            return ep.load()
    raise KeyError(name)
994650
def _init(self):
        

        self._entry_points = {}
        for entry_point in self.raw_entry_points:
            if entry_point.dist.project_name != self.reserved.get(
                    entry_point.name, entry_point.dist.project_name):
                logger.error(
                    "registry '%s' for '%s' is reserved for package '%s'",
                    entry_point.name, self.registry_name,
                    self.reserved[entry_point.name],
                )
                continue

            if self.get_record(entry_point.name):
                logger.warning(
                    "registry '%s' for '%s' is already registered.",
                    entry_point.name, self.registry_name,
                )
                existing = self._entry_points[entry_point.name]
                logger.debug(
                    "registered '%s' from '%s'", existing, existing.dist)
                logger.debug(
                    "discarded '%s' from '%s'", entry_point, entry_point.dist)
                continue

            logger.debug(
                "recording '%s' from '%s'", entry_point, entry_point.dist)
            self._entry_points[entry_point.name] = entry_point
1000043
def _load_plugin_entrypoints(self):
        """"""
        from pkg_resources import iter_entry_points

        def load_plugin(ep):
            if plugins_env == ['no']:
                return False
            elif ep.module_name in exclude_plugins:
                return False
            elif include_plugins and ep.module_name not in include_plugins:
                return False
            return True

        self._plugins = self._plugins or []

        plugins_env = os.getenv('PSYPLOT_PLUGINS', '').split('::')
        include_plugins = [s[4:] for s in plugins_env if s.startswith('yes:')]
        exclude_plugins = [s[3:] for s in plugins_env if s.startswith('no:')]

        logger = logging.getLogger(__name__)

        for ep in iter_entry_points(group='psyplot', name='plugin'):
            if not load_plugin(ep):
                logger.debug('Skipping entrypoint %s', ep)
                continue
            self._plugins.append(str(ep))
            logger.debug('Loading entrypoint %s', ep)
            yield ep
759518
def iload(cls, entry_point='numina.pipeline.1'):
        """"""

        for entry in pkg_resources.iter_entry_points(group=entry_point):
            try:
                drp_loader = entry.load()
                drpins = drp_loader()
                if cls.instrumentdrp_check(drpins, entry.name):
                    yield drpins
            except Exception as error:
                print('Problem loading', entry, file=sys.stderr)
                print("Error is: ", error, file=sys.stderr)
1152757
def init_app(self, app,
                 entry_point_group_mappings='invenio_search.mappings',
                 entry_point_group_templates='invenio_search.templates',
                 **kwargs):
        
        self.init_config(app)

        app.cli.add_command(index_cmd)

        state = _SearchState(
            app,
            entry_point_group_mappings=entry_point_group_mappings,
            entry_point_group_templates=entry_point_group_templates,
            **kwargs
        )
        self._state = app.extensions['invenio-search'] = state
670144
def load_entry_point_system_roles(self, entry_point_group):
        
        for ep in pkg_resources.iter_entry_points(group=entry_point_group):
            self.register_system_role(ep.load())
723695
def _loader(app, init_func, entry_points=None, modules=None):
    
    if entry_points:
        for entry_point in entry_points:
            for ep in pkg_resources.iter_entry_points(entry_point):
                try:
                    init_func(ep.load())
                except Exception:
                    app.logger.error(
                        'Failed to initialize entry point: {0}'.format(ep))
                    raise
    if modules:
        for m in modules:
            try:
                init_func(m)
            except Exception:
                app.logger.error('Failed to initialize module: {0}'.format(m))
                raise
1370589
def entry_point():
    """"""
    try:
        provider_group_factory()
        notifiers_cli(obj={})
    except NotifierException as e:
        click.secho(f"ERROR: {e.message}", bold=True, fg="red")
        exit(1)
985406
def entrypoint(args=None):
    

    mondrian.setup(excepthook=True)
    logger = logging.getLogger()
    logger.setLevel(settings.LOGGING_LEVEL.get())

    parser = argparse.ArgumentParser()
    parser.add_argument("--debug", "-D", action="store_true")

    subparsers = parser.add_subparsers(dest="command")
    subparsers.required = True

    commands = {}

    def register_extension(ext):
        nonlocal commands

        try:
            parser = subparsers.add_parser(ext.name)
            if isinstance(ext.plugin, type) and issubclass(ext.plugin, BaseCommand):
                # current way, class based.
                cmd = ext.plugin()
                cmd.add_arguments(parser)
                cmd.__name__ = ext.name
                commands[ext.name] = cmd.handle
            else:
                # old school, function based.
                commands[ext.name] = ext.plugin(parser)
        except Exception:
            logger.exception("Error while loading command {}.".format(ext.name))

    from stevedore import ExtensionManager

    mgr = ExtensionManager(namespace="bonobo.commands")
    mgr.map(register_extension)

    parsed_args = parser.parse_args(args).__dict__

    if parsed_args.pop("debug", False):
        settings.DEBUG.set(True)
        settings.LOGGING_LEVEL.set(logging.DEBUG)
        logger.setLevel(settings.LOGGING_LEVEL.get())

    logger.debug("Command: " + parsed_args["command"] + " Arguments: " + repr(parsed_args))

    # Get command handler, execute, rince.
    command = commands[parsed_args.pop("command")]
    command(**parsed_args)

    return 0
1082332
def load_fetchers_entry_point_group(self, entry_point_group):
        
        for ep in pkg_resources.iter_entry_points(group=entry_point_group):
            self.register_fetcher(ep.name, ep.load())
737213
def iter_entry_points(cls, target):
    """"""
    for name, binary_target in target.provided_binaries.items():
      concrete_target = binary_target
      if not isinstance(concrete_target, PythonBinary) or concrete_target.entry_point is None:
        raise TargetDefinitionException(target,
            'Cannot add a binary to a PythonArtifact if it does not contain an entry_point.')
      yield name, concrete_target.entry_point
514112
def cli(ctx, group, user):
    
    return ctx.gi.users.add_to_group(group, user)
964497
def load_commands_from_entry_point(self, specifier):
        
        for ep in pkg_resources.iter_entry_points(specifier):
            module = ep.load()
            command.discover_and_call(module, self.command)
1323773
function add_group() {
    server.EntryGroupNew(function(err, path) {
      if (err) {
        sails.log.error('DBus: Could not call org.freedesktop.Avahi.Server.EntryGroupNew');
        return;
      }
      service.getInterface(
        path,
        avahi.DBUS_INTERFACE_ENTRY_GROUP.value,
        function (
          err,
          newGroup
        ) {
          group = newGroup;
          add_service();
        }
      )
    });
  }
999786
def entrypoint(cls):
    
    if not isinstance(cls, type) or not issubclass(cls, Command):
        raise TypeError(f"inappropriate entrypoint instance of type {cls.__class__}")
    cls._argcmdr_entrypoint_ = True
    return cls