a ì)g/ ã@s®ddlmZmZmZeZddlmZddlm Z m Z m Z m Z ddl mZddlmZmZmZddlmZdd„ZGd d „d eeƒZGd d „d eƒZeeƒGd d„deƒƒZdS)é)Úabsolute_importÚdivisionÚprint_function)ÚABCMeta)Ú ContainerÚMappingÚSequenceÚSet)Ú ImmutableDict)Ú add_metaclassÚ binary_typeÚ text_type)Ú SingletoncCsèt|ttfƒr|St|tƒrZi}| ¡D](\}}t|tƒrHt|ƒ||<q(|||<q(t|ƒSt|tƒr t ƒ}|D](}t|tƒrŒ|  t|ƒ¡qn|  |¡qnt |ƒSt|t ƒräg}|D](}t|tƒrÐ|  t|ƒ¡q²|  |¡q²t|ƒS|S)zRRecursively convert a container and objects inside of it into immutable data types)Ú isinstancer r rÚitemsrÚ_make_immutabler r ÚsetÚaddÚ frozensetrÚappendÚtuple)ÚobjZ temp_dictÚkeyÚvalueZtemp_setZ temp_sequence©rúA/usr/lib/python3.9/site-packages/ansible/utils/context_objects.pyrs0         rc@seZdZdZdS)Ú _ABCSingletonzÿ Combine ABCMeta based classes with Singleton based classes Combine Singleton and ABCMeta so we have a metaclass that unambiguously knows which can override the other. Useful for making new types of containers which are also Singletons. N©Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrr5srcs,eZdZdZ‡fdd„Zedd„ƒZ‡ZS)ÚCLIArgsa/ Hold a parsed copy of cli arguments We have both this non-Singleton version and the Singleton, GlobalCLIArgs, version to leave us room to implement a Context object in the future. Whereas there should only be one set of args in a global context, individual Context objects might want to pretend that they have different command line switches to trigger different behaviour when they run. So if we support Contexts in the future, they would use CLIArgs instead of GlobalCLIArgs to store their version of command line flags. cs6i}| ¡D]\}}t|ƒ||<q tt|ƒ |¡dS©N)rrÚsuperr"Ú__init__)ÚselfÚmappingZtoplevelrr©Ú __class__rrr%JszCLIArgs.__init__cCs |t|ƒƒSr#)Úvars)ÚclsÚoptionsrrrÚ from_optionsPszCLIArgs.from_options)rrr r!r%Ú classmethodr-Ú __classcell__rrr(rr"?s r"c@seZdZdZdS)Ú GlobalCLIArgsz| Globally hold a parsed copy of cli arguments. Only one of these exist per program as it is for global context Nrrrrrr0Usr0N)Z __future__rrrÚtypeZ __metaclass__ÚabcrÚcollections.abcrrrr Z'ansible.module_utils.common.collectionsr Zansible.module_utils.sixr r r Zansible.utils.singletonrrrr"r0rrrrÚs   !