Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/autocommand/__pycache__/autoparse.cpython-39.pyc
Ðазад
a i�hz- � @ 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� Zd"ddddd�dd�Zed d!� �ZdS )#� N)�compile)� signature�getdoc� Parameter)�ArgumentParser)�contextmanager)�wraps)�IOBase)�AutocommandErrorc @ s e Zd ZdZdS )�AnnotationErrorzEAnnotation error: annotation must be a string, type, or tuple of bothN��__name__� __module__�__qualname__�__doc__� r r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/autocommand/autoparse.pyr s r c @ s e Zd ZdZdS )�PositionalArgErrorzQ Postional Arg Error: autocommand can't handle postional-only parameters Nr r r r r r # s r c @ s e Zd ZdZdS )� KWArgErrorz:kwarg Error: autocommand can't handle a **kwargs parameterNr r r r r r ) s r c @ s e Zd ZdZdS )�DocstringErrorzDocstring errorNr r r r r r - s r c @ s e Zd ZdZdS )�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 s r c C s� | t u rdS t| �r| dfS t| t�r.d| fS t| t�r�z| \}}W n. tyr } zt| �|�W Y d}~n>d}~0 0 t|�r�t|t�r�||fS t|t�r�t|�r�||fS t| ��dS )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 rt| ��n| j | ju r*t| ��i }d}t| j�\}}| j}|du rb|tdhvrbt |�}|turv||d<