def loadPlugins(self):
        """
        Determine which capsule plugins are relevant to this system, and load
        them.

        This uses a simple test such as the existence of a directory to
        determine whether each plugin is useful. At some point the contents of
        the conary database should also be factored in, so that deleting the
        capsule target database and running a sync should erase all of those
        capsule troves.
        """
        db = self._db()
        for kind, (module, className, checkFunc
                ) in self.availablePlugins.iteritems():
            if kind in self._loadedPlugins:
                continue
            if isinstance(checkFunc, basestring):
                path = util.joinPaths(db.root, checkFunc)
                try:
                    if not os.stat(path).st_size:
                        continue
                except __HOLE__:
                    continue
            else:
                if not checkFunc():
                    continue
            __import__(module)
            cls = getattr(sys.modules[module], className)
            self._loadedPlugins[kind] = cls(db)
dataset/ETHPy150Open sassoftware/conary/conary/local/capsules.py/MetaCapsuleDatabase.loadPlugins