o nnh9 @szddlmZddlmZddlmZddlmZddlm Z ddl m Z ddl m Z e Zedd d Zedd d ZdS)) annotations) AnsibleError)!with_collection_artifacts_manager)find_existing_collections)to_bytes)_get_collection_name_from_path)DisplayNTcCs.i}t||||dD] }t|}|||<q |S)N) search_paths coll_filterartifacts_managerdedupe)list_collection_dirsr)r r r r collections candidate collectionrC/usr/local/lib/python3.10/dist-packages/ansible/collections/list.pylist_collectionss  rc csd}d}d}|durVt|tr|g}t}|D]9}d|vrHz |d\}} Wn ty4td|w|||sG|durBg}|| q||d}d}qt|}t |||||dD]} |sm|durm| j |vrmq_t | j Vq_dS)aO Return paths for the specific collections found in passed or configured search paths :param search_paths: list of text-string paths, if none load default config :param coll_filter: limit collections to just the specific namespace or collection, if None all are returned :return: list of collection directory paths NF.z'Invalid collection pattern supplied: %sT)namespace_filtercollection_filterr ) isinstancestrsetsplit ValueErrorraddappendsortedrfqcnrsrc) r r r r rrhas_pure_namespace_filter coll_name namespacerreqrrrr s@        r )NNTN)NNNT) __future__ransible.errorsransible.cli.galaxyransible.galaxy.collectionr+ansible.module_utils.common.text.convertersr2ansible.utils.collection_loader._collection_finderransible.utils.displayrdisplayrr rrrrs