File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/setuptools/_vendor/autocommand/__pycache__/autoparse.cpython-310.pyc
Back
o ;jz- � @ s d dl Z d dlmZ d dlmZmZmZ d dlm Z d dl mZ d dlm Z d dlmZ d dlmZ ejZG d d � d e�ZG dd� de�ZG d d� de�ZG dd� de�ZG dd� de�Zdd� Zdd� Zdd� Zed�Zdd� Z d"ddddd�dd�Zed d!� �ZdS )#� N)�compile)� signature�getdoc� Parameter)�ArgumentParser)�contextmanager)�wraps)�IOBase)�AutocommandErrorc @ � e Zd ZdZdS )�AnnotationErrorzEAnnotation error: annotation must be a string, type, or tuple of bothN��__name__� __module__�__qualname__�__doc__� r r �\/opt/saltstack/salt/lib/python3.10/site-packages/setuptools/_vendor/autocommand/autoparse.pyr � r c @ r )�PositionalArgErrorzQ Postional Arg Error: autocommand can't handle postional-only parameters Nr r r r r r # r r c @ r )� KWArgErrorz:kwarg Error: autocommand can't handle a **kwargs parameterNr r r r r r ) r r c @ r )�DocstringErrorzDocstring errorNr r r r r r - r r c @ r )�TooManySplitsErrorz� The docstring had too many ---- section splits. Currently we only support using up to a single split, to split the docstring into description and epilog parts. Nr r r r r r 1 r r c C s� | t u rdS t| �r| dfS t| t�rd| fS t| t�rNz| \}}W n ty3 } zt| �|�d}~ww t|�rAt|t�rA||fS t|t�rNt|�rN||fS t| ��)z� Given an annotation, return the (type, description) for the parameter. If you provide an annotation that is somehow both a string and a callable, the behavior is undefined. )NNN)�_empty�callable� isinstance�str�tuple� ValueErrorr )� annotationZarg1Zarg2�er r r �_get_type_description9 s$ ��r! c C s� | j | ju r t| ��| j | ju rt| ��i }d}t| j�\}}| j}|du r0|tdhvr0t |�}|tur:||d<