관리-도구
편집 파일: attribute.cpython-39.pyc
a �)gV � @ s~ d dl mZmZmZ eZd dlmZmZ d dlm Z e d�ZG dd� d�ZG dd� de�Z G d d � d e�ZG dd� de�Zd S )� )�absolute_import�division�print_function)�copy�deepcopy)�Sentinel)�list�dict�setc @ sh e Zd Zddd�Zdd� Zdd � Zd d� Zdd � Zdd� Zdd� Z dd� Z ddd�Zdd� Zdd� Z dS )� AttributeNFr c C sb || _ || _|| _|| _|| _|| _|| _|| _| | _| | _ |dur^| j t v r^t|�s^td��dS )a� :class:`Attribute` specifies constraints for attributes of objects which derive from playbook data. The attributes of the object are basically a schema for the yaml playbook. :kwarg isa: The type of the attribute. Allowable values are a string representation of any yaml basic datatype, python class, or percent. (Enforced at post-validation time). :kwarg private: Not used at runtime. The docs playbook keyword dumper uses it to determine that a keyword should not be documented. mpdehaan had plans to remove attributes marked private from the ds so they would not have been available at all. :kwarg default: Default value if unspecified in the YAML document. :kwarg required: Whether or not the YAML document must contain this field. If the attribute is None when post-validated, an error will be raised. :kwarg listof: If isa is set to "list", this can optionally be set to ensure that all elements in the list are of the given type. Valid values here are the same as those for isa. :kwarg priority: The order in which the fields should be parsed. Generally this does not need to be set, it is for rare situations where another field depends on the fact that another field was parsed first. :kwarg class_type: If isa is set to "class", this can be optionally set to a class (not a string name). The YAML data for this field will be passed to the __init__ method of that class during post validation and the field will be an instance of that class. :kwarg always_post_validate: Controls whether a field should be post validated or not (default: False). :kwarg alias: An alias to use for the attribute name, for situations where the attribute name may conflict with a Python reserved word. NzQdefaults for FieldAttribute may not be mutable, please provide a callable instead) �isa�private�default�required�listof�priority� class_type�always_post_validate�alias�static�_CONTAINERS�callable� TypeError)�selfr r r r r r r r r r � r �>/usr/lib/python3.9/site-packages/ansible/playbook/attribute.py�__init__ s ,zAttribute.__init__c C s || _ d S �N)�name)r �ownerr r r r �__set_name__Y s zAttribute.__set_name__c C s |j | j kS r �r �r �otherr r r �__eq__\ s zAttribute.__eq__c C s |j | j kS r r! r"