(self, cls, force=False)
Registers the plugin in the registry.

        :param cls mixed.
        :param bool force:
Registers the plugin in the registry.
Registers the plugin in the registry .
def register(self, cls, force=False):
        """
        Registers the plugin in the registry.

        :param cls mixed.
        :param bool force:
        """
        if not issubclass(cls, self.type):
            raise InvalidRegistryItemType(
                "Invalid item type `{0}` for "
                "registry `{1}`".format(cls, self.__class__)
            )

        # If item has not been forced yet, add/replace its' value in the
        # registry
        if force:

            if cls.uid not in self._forced:
                self._registry[cls.uid] = cls
                self._forced.append(cls.uid)
                return True
            else:
                return False

        else:

            if cls.uid in self._registry:
                return False
            else:
                self._registry[cls.uid] = cls
                return True
def register ( self , cls , force = False ) : if not issubclass ( cls , self . type ) : raise InvalidRegistryItemType ( "Invalid item type `{0}` for " "registry `{1}`" . format ( cls , self . __class__ ) ) # If item has not been forced yet, add/replace its' value in the # registry if force : if cls . uid not in self . _forced : self . _registry [ cls . uid ] = cls self . _forced . append ( cls . uid ) return True else : return False else : if cls . uid in self . _registry : return False else : self . _registry [ cls . uid ] = cls return True