Loads the channels and tools given the plugin path specified

        :return: The loaded channels, including a tool channel, for the tools found.
543804
def load_channels(self):
        
        channels = []

        # Try to get channels
        for channel_name in self.channel_names:
            channel_path = os.path.join(self.path, "channels")
            sys.path.append(self.path)
            mod = imp.load_module(channel_name, *imp.find_module(channel_name, [channel_path]))
            cls = getattr(mod, channel_name.title().replace("_", ""))
            channel_id = channel_name.split("_")[0]
            # TODO: what about up_to_timestamp?
            try:
                channels.append(cls(channel_id, up_to_timestamp=None))
            except TypeError:
                channels.append(cls(channel_id))

        # Try to get tools
        if self.has_tools:
            tool_path = os.path.join(self.path, "tools")
            # Create a tool channel using this path
            channel_id = self.channel_id_prefix + "_" + "tools"
            channel = ToolChannel(channel_id, tool_path, up_to_timestamp=utcnow())
            channels.append(channel)

        if self.has_assets:
            assset_path = os.path.join(os.path.abspath(self.path), "assets")
            channel_id = self.channel_id_prefix + "_" + "assets"
            channel = AssetsFileChannel(channel_id, assset_path, up_to_timestamp=utcnow())
            channels.append(channel)
            #
            # from . import TimeInterval
            # channel.streams.values()[0].window(TimeInterval.up_to_now()).items()

        return channels
1101720
def __discoverPlugins():
    
    for app in settings.INSTALLED_APPS:
        if not app.startswith('django'):
            module = __import__(app)
            moduledir = path.Path(module.__file__).parent
            plugin = moduledir / 'frog_plugin.py'
            if plugin.exists():
                file_, fpath, desc = imp.find_module('frog_plugin', [moduledir])
                if file_:
                    imp.load_module('frog_plugin', file_, fpath, desc)

    return FrogPluginRegistry.plugins
865680
def load_plugins(self, args=None):
        """"""
        for item in os.listdir(plugins_path):
            if (item.startswith(self.header) and
                    item.endswith(".py") and
                    item != (self.header + "plugin.py")):
                # Load the plugin
                self._load_plugin(os.path.basename(item),
                                  args=args, config=self.config)

        # Log plugins list
        logger.debug("Active plugins list: {}".format(self.getPluginsList()))
1034676
def query_plugins(entry_point_name):
    
    entries = {}
    for entry_point in pkg_resources.iter_entry_points(entry_point_name):
        entries[entry_point.name] = entry_point.load()
    return entries
577487
def load_installed_plugins(self):
        
        result = []
        plugin_dirs = [d for d in os.listdir(self.plugin_path) if os.path.isdir(os.path.join(self.plugin_path, d))]
        settings = constants.SETTINGS

        for d in plugin_dirs:
            if d == "__pycache__":
                continue
            try:
                class_module = self.load_plugin(d)
                plugin = class_module()
                plugin.plugin_path = os.path.join(self.plugin_path, plugin.name)
                plugin.load_description()
                plugin.enabled = settings.value(plugin.name, type=bool) if plugin.name in settings.allKeys() else False
                result.append(plugin)
            except ImportError as e:
                logger.warning("Could not load plugin {0} ({1})".format(d, e))
                continue

        return result
216154
def plugins(self):
        
        from fluent_contents import extensions   # Avoid circular reference because __init__.py imports subfolders too
        if self._plugins is None:
            return extensions.plugin_pool.get_plugins()
        else:
            return extensions.plugin_pool.get_plugins_by_name(*self._plugins)
436457
def get_tools_paths(self):
        """"""
        if settings.DEBUG or is_testing():
            return list(get_apps_tools().values())

        else:
            tools_root = settings.FLOW_TOOLS_ROOT
            subdirs = next(os.walk(tools_root))[1]

            return [os.path.join(tools_root, sdir) for sdir in subdirs]
710409
def load_modules(self, args):
        """"""

        # Init the plugins dict
        # Active plugins dictionnary
        self._plugins = collections.defaultdict(dict)
        # Load the plugins
        self.load_plugins(args=args)

        # Init the export modules dict
        # Active exporters dictionnary
        self._exports = collections.defaultdict(dict)
        # All available exporters dictionnary
        self._exports_all = collections.defaultdict(dict)
        # Load the export modules
        self.load_exports(args=args)

        # Restoring system path
        sys.path = sys_path
32668
def plugins(self):
        

        if self._plugins is None:
            self._plugins = {}

            for _, plugin in self.load_extensions('iotile.plugin'):
                links = plugin()
                for name, value in links:
                    self._plugins[name] = value

        return self._plugins
998588
public static void loadPluginPath(final String plugin_path) {
    if (plugin_path != null && !plugin_path.isEmpty()) {
      try {
        PluginLoader.loadJARs(plugin_path);
      } catch (Exception e) {
        LOG.error("Error loading plugins from plugin path: " + plugin_path, e);
        throw new RuntimeException("Error loading plugins from plugin path: " +
                plugin_path, e);
      }
    }
  }
462075
def reload(self):
        
        logger.debug("Reloading Plugins...")

        deleted_modules = set(self.loaded_modules.keys())

        for plugin_file in self._get_plugin_files(self.plugin_dirs):
            if plugin_file not in self.loaded_modules:
                logger.debug("New Plugin Module found. Loading: %s", plugin_file)
                self._load_plugin(plugin_file)
            elif _md5sum(plugin_file) != self.loaded_modules[plugin_file].md5:
                deleted_modules.remove(plugin_file)
                logger.debug("Plugin Module changed. Reloading: %s", plugin_file)
                self._load_plugin(plugin_file)
            else:
                deleted_modules.remove(plugin_file)

        for plugin_file in deleted_modules:
            logger.debug("Plugin Module deleted. Removing: %s", plugin_file)
            del self.loaded_modules[plugin_file]
325907
def load_plugins(self, plugins_package):
        '''  '''
        try:
            # Resolve directory in the filesystem
            plugin_dir = find_spec(plugins_package).submodule_search_locations[0]
        except ImportError:
            logger.error(
                "Could not load plugins package '%(pkg)s'", {'pkg': plugins_package}
            )
            return

        for module_path in self._get_plugin_module_paths(plugin_dir):
            # Load the module dynamically
            spec = find_spec('{}.{}'.format(plugins_package, module_path))
            m = module_from_spec(spec)
            spec.loader.exec_module(m)

            # Get classes from module and extract the plugin classes
            classes = inspect.getmembers(m, predicate=inspect.isclass)
            for _, klass in classes:
                # Avoid imports processing
                if klass.__module__ != spec.name:
                    continue

                # Avoid classes not ending in Plugin
                if not klass.__name__.endswith('Plugin'):
                    continue

                instance = klass()
                if self._is_plugin_ok(instance):
                    self.plugins.add(instance)
36725
def _get_spyderplugins(plugin_path, is_io, modnames, modlist):
    """"""
    if not osp.isdir(plugin_path):
        return

    for name in os.listdir(plugin_path):
        # This is needed in order to register the spyder_io_hdf5 plugin.
        # See issue 4487
        # Is this a Spyder plugin?
        if not name.startswith(PLUGIN_PREFIX):
            continue

        # Ensure right type of plugin
        if is_io != name.startswith(IO_PREFIX):
            continue

        # Skip names that end in certain suffixes
        forbidden_suffixes = ['dist-info', 'egg.info', 'egg-info', 'egg-link',
                              'kernels']
        if any([name.endswith(s) for s in forbidden_suffixes]):
            continue

        # Import the plugin
        _import_plugin(name, plugin_path, modnames, modlist)
172568
def get_custom_modules_path() -> Path:
    
    channel_path = get_base_path() / "modules"
    if not channel_path.exists():
        channel_path.mkdir(parents=True)
    return channel_path
388097
protected void loadJars(Path pluginPath, PluginClassLoader pluginClassLoader) {
        for (String libDirectory : pluginClasspath.getLibDirectories()) {
            Path file = pluginPath.resolve(libDirectory);
            List<File> jars = FileUtils.getJars(file);
            for (File jar : jars) {
                pluginClassLoader.addFile(jar);
            }
        }
    }
918
def load_installed_plugins():
        """"""
        providers = {}
        checkers = {}
        for entry_point in pkg_resources.iter_entry_points(group='archan'):
            obj = entry_point.load()
            if issubclass(obj, Provider):
                providers[entry_point.name] = obj
            elif issubclass(obj, Checker):
                checkers[entry_point.name] = obj
        return collections.namedtuple(
            'Plugins', 'providers checkers')(
                providers=providers,
                checkers=checkers)
472716
def load_all_plugins(self):
        """"""

        # Go through the existing python files in the plugin directory
        self.plugin_path = os.path.realpath(self.plugin_dir)
        sys.path.append(self.plugin_dir)
        print '<<< Plugin Manager >>>'
        for f in [os.path.join(self.plugin_dir, child) for child in os.listdir(self.plugin_dir)]:

            # Skip certain files
            if '.DS_Store' in f or '__init__.py' in f: 
                continue

            # Add the plugin
            self.add_plugin(f)