관리-도구
편집 파일: context_objects.cpython-39.pyc
a �����)g/����������������������@���s����d�dl�mZmZmZ�eZd�dlmZ�d�dlm Z m Z mZmZ�d�dl mZ�d�dlmZmZmZ�d�dlmZ�dd��ZG�d d ��d ee�ZG�dd��de�Zee�G�d d��de��ZdS�)�����)�absolute_import�division�print_function)�ABCMeta)� Container�Mapping�Sequence�Set)� ImmutableDict)� add_metaclass�binary_type� text_type)� Singletonc�����������������C���s����t�|�ttf�r|�S�t�|�t�rZi�}|����D�](\}}t�|t�rHt|�||<�q(|||<�q(t|�S�t�|�t�r�t ��}|�D�](}t�|t�r�|� t|���qn|� |��qnt|�S�t�|�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.pyr������s0���� r���c�������������������@���s���e�Zd�ZdZdS�)� _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__r���r���r���r���r���5���s���r���c�����������������������s,���e�Zd�ZdZ��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. c��������������������s6���i�}|����D�]\}}t|�||<�qtt|���|��d�S��N)r���r����superr"����__init__)�self�mappingZtoplevelr���r����� __class__r���r���r%���J���s����zCLIArgs.__init__c�����������������C���s���|�t�|��S�r#���)�vars)�cls�optionsr���r���r����from_optionsP���s����zCLIArgs.from_options)r���r���r ���r!���r%����classmethodr-���� __classcell__r���r���r(���r���r"���?���s��� r"���c�������������������@���s���e�Zd�ZdZdS�)� GlobalCLIArgsz| Globally hold a parsed copy of cli arguments. Only one of these exist per program as it is for global context Nr���r���r���r���r���r0���U���s���r0���N)Z __future__r���r���r����typeZ __metaclass__�abcr����collections.abcr���r���r���r ���Z'ansible.module_utils.common.collectionsr ���Zansible.module_utils.sixr���r���r ���Zansible.utils.singletonr���r���r���r"���r0���r���r���r���r����<module>���s���!