def get_categories_path()

in src/dubbo/registry/zookeeper/zk_registry.py [0:0]


    def get_categories_path(self, url: URL) -> list[str]:
        """
        Get the categories' path.
        :param url: The URL.
        :type url: URL
        :return: The categories' paths.
        :rtype: List[str]
        """
        # get the categories
        if common_constants.ANY_VALUE == url.parameters.get(registry_constants.CATEGORY_KEY):
            categories = [
                registry_constants.PROVIDERS_CATEGORY,
                registry_constants.CONSUMERS_CATEGORY,
            ]
        else:
            parameter = url.parameters.get(registry_constants.CATEGORY_KEY, registry_constants.PROVIDERS_CATEGORY)
            categories = [s.strip() for s in parameter.split(common_constants.COMMA_SEPARATOR)]

        # get paths
        return [self.get_service_path(url) + common_constants.PATH_SEPARATOR + category for category in categories]