U cfO @sFddlZddlmZddlmZmZmZmZmZm Z m Z m Z m Z m Z e dZee ee ee eefe eeeffZeZGdddeZe ee ee eddd Ze d d eee ege efd d d Zddd ee eeee e eee ege effddd Ze ee ee edddZe d d eee ege efd ddZdd d ee eee e eee ege effdddZedkrBeGdddZeZddlmZeZedeeejeddejeddeddej_ eeejeddejedddS) N)partial) AnyCallableIterableListOptionalTupleTypeTypeVarUnionoverloadTc@seZdZdZdS) ReprErrorz2An error occurred when attempting to build a repr.N)__name__ __module__ __qualname____doc__rrC/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/rich/repr.pyrsr)clsreturncCsdSNrrrrrautosrFangular)rrcCsdSrrrrrrr srrrcCsDdttttttddd}|dkr4t||dS|||dSdS)z5Class decorator to create __repr__ from __rich_repr__NrcSsZttddd}tttddd}t|ds:d|_||_d|_||_|dk rV||j_|S) N)selfrcSsg}|j}t|jdd}|D]~}t|trt|dkrL|t|dq|^}}}|dkrl|t|q|r~|d|kr~q ||d|q |t|q |rd|jjdd |d S|jjd d |d SdS) z%Create repr string from __rich_repr__rFrN=< >(z, )) appendgetattr __rich_repr__ isinstancetuplelenrepr __class__rjoin)rrepr_strr%rargkeyvaluedefaultrrr auto_repr+s"    z+auto..do_replace..auto_reprc sszt|j}|jD]h\}}|j|jkr:t||Vq|j|j|j fkr|j |j krht||j Vq|j t||j |j fVqWn2t k r}ztd|dW5d}~XYnXdS)z5Auto generate __rich_rep__ from signature of __init__z'Failed to auto generate __rich_repr__; N)inspect signature__init__ parametersitemskindPOSITIONAL_ONLYr&POSITIONAL_OR_KEYWORD KEYWORD_ONLYr2emptyname Exceptionr)rr5r>paramerrorrrrauto_rich_reprDs$   z0auto..do_replace..auto_rich_reprr'zBuild a rich reprzReturn repr(self)) r strr Resulthasattrrr'__repr__r)rrr3rBrrr do_replace*s zauto..do_replacer)N)r r rboolr)rrrGrrrr%s 8 cCsdSrrrrrr rich_reprhsrIcCsdSrrrrrrrImscCs|dkrt|dSt|SdS)Nr)r)rrrrrrIrs __main__c@seZdZedddZdS)Foo)rccs$dVdddddgifVdVdS)NfoobarZshoppingeggsZham pineapple)Zbuyzhand sanitizerr)rrrrr'szFoo.__rich_repr__N)rrrrDr'rrrrrK}srK)Consolez Standard repr<)widthz Angular reprT)N)N)!r4 functoolsrtypingrrrrrrr r r r r rCrDRichReprResultr?rrrHrIrrKrLpip._vendor.rich.consolerPconsoleruleprintr'rrrrrsZ 0 **  C*