How to use the entrypoints.iter_files_distros function in entrypoints

To help you get started, we’ve selected a few entrypoints examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iotile / coretools / iotilecore / iotile / core / dev / registry.py View on Github external
def _dump_extensions(cls, prefix="iotile."):
        extensions = {}

        for config, distro in entrypoints.iter_files_distros():
            if distro is None:
                distro_info = None
            else:
                distro_info = (distro.name, distro.version)

            for group in config:
                if prefix is not None and not group.startswith(prefix):
                    continue

                if group not in extensions:
                    extensions[group] = []

                for name, epstr in config[group].items():
                    extensions[group].append(dict(name=name, object=epstr, distribution=distro_info))

        return extensions