选择文件�文件大�最�修改时间�作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
a ´iÿWã @sødZddlZddlZddlZddlZddlm Z gd¢Z d&ddd œd d „Z d'ddd œd d „Z ddœdd„Zdd„Zdd„Zdd„ZGdd„dƒZdd„ZGdd„dƒZdd„ZeeeeeeeeedƒhƒZdd „Z d(d!d"„Z!d#d$„Z"e#d%k�rôe!ƒdS))a/Support to pretty-print lists, tuples, & dictionaries recursively. Very simple, but useful, especially in debugging data structures. Classes ------- PrettyPrinter() Handle pretty-printing operations onto a stream using a configured set of formatting parameters. Functions --------- pformat() Format a Python object into a pretty-printed representation. pprint() Pretty-print a Python object to a stream [default is sys.stdout]. saferepr() Generate a 'standard' repr()-like value, but protect against recursive data structures. éN)ÚStringIO)ÚpprintÚpformatÚ isreadableÚ isrecursiveÚsafereprÚ PrettyPrinterÚppééPFT©ÚcompactÚ sort_dictscCs"t||||||d�}| |¡dS)zAPretty-print a Python object to a stream [default is sys.stdout].)ÚstreamÚindentÚwidthÚdepthr rN)rr)Úobjectrrrrr rZprinter©rú/usr/lib64/python3.9/pprint.pyr/s þrcCst|||||d� |¡S)zrr r NFTr cCs‚t|ƒ}t|ƒ}|dkr tdƒ‚|dur8|dkr8tdƒ‚|sDtdƒ‚||_||_||_|durf||_ntj|_t|ƒ|_ ||_ dS)aƒHandle pretty printing operations onto a stream using a set of configured parameters. indent Number of spaces to indent for each level of nesting. width Attempted maximum number of columns in the output. depth The maximum depth to print out nested structures. stream The desired output stream. If omitted (or false), the standard output stream available at construction will be used. compact If true, several items will be combined in one line. sort_dicts If true, dict keys are sorted. rzindent must be >= 0Nzdepth must be > 0zwidth must be != 0) ÚintÚ ValueErrorÚ_depthÚ_indent_per_levelÚ_widthÚ_streamÚ_sysÚstdoutÚboolÚ_compactÚ _sort_dicts)rrrrrr rrrrr hs  zPrettyPrinter.__init__cCs&| ||jddid¡|j d¡dS)NrÚ )Ú_formatr3Úwrite©rrrrrr“szPrettyPrinter.pprintcCs"tƒ}| ||ddid¡| ¡S©Nr)Ú _StringIOr:Úgetvalue)rrÚsiorrrr—szPrettyPrinter.pformatcCs| |idd¡dS)Nrr©Úformatr<rrrrœszPrettyPrinter.isrecursivecCs | |idd¡\}}}|o| Sr=rA)rrÚsÚreadableÚ recursiverrrrŸszPrettyPrinter.isreadablec CsÞt|ƒ}||vr.| t|ƒ¡d|_d|_dS| |||¡}|j||} t|ƒ| krÐ|j  t |ƒj d¡} | durœd||<| |||||||dƒ||=dSt |t ƒrÐd||<| ||||||d¡||=dS| |¡dS)NTFr )r$r;Ú _recursionÚ _recursiveÚ _readableÚ_reprr2ÚlenÚ _dispatchÚgetr#Ú__repr__Ú isinstanceÚdictÚ _pprint_dict) rrrrÚ allowanceÚcontextÚlevelÚobjidÚrepÚ max_widthÚprrrr:£s.   ÿzPrettyPrinter._formatc Csz|j}|dƒ|jdkr*||jddƒt|ƒ}|rn|jrNt| ¡td�} n| ¡} | | |||d||¡|dƒdS)NÚ{r ú ©ÚkeyÚ})r;r1rJr8ÚsortedÚitemsr-Ú_format_dict_items) rrrrrQrRrSr;Úlengthr^rrrrP½s ÿzPrettyPrinter._pprint_dictcCslt|ƒs| t|ƒ¡dS|j}| |jd¡| t| ¡ƒ||t|jƒd|d||¡| d¡dS)Nú(r ú))rJr;ÚreprÚ __class__r'r:Úlistr^)rrrrrQrRrSÚclsrrrÚ_pprint_ordered_dictÎsþz"PrettyPrinter._pprint_ordered_dictcCs0| d¡| ||||d||¡| d¡dS)Nú[r ú])r;Ú _format_items©rrrrrQrRrSrrrÚ _pprint_listÛs  ÿzPrettyPrinter._pprint_listcCsH| d¡t|ƒdkrdnd}| ||||t|ƒ||¡| |¡dS)Nrar z,)rb)r;rJrj)rrrrrQrRrSÚendcharrrrÚ _pprint_tupleãs  ÿzPrettyPrinter._pprint_tuplec Cs”t|ƒs| t|ƒ¡dS|j}|tur8| d¡d}n&| |jd¡d}|t|jƒd7}t|td�}| ||||t|ƒ||¡| |¡dS)NrXr\ú({ú})r rZ) rJr;rcrdÚsetr'r]rrj) rrrrrQrRrSÚtyprmrrrÚ _pprint_setìs  ÿzPrettyPrinter._pprint_setcCsÌ|j}t|ƒs|t|ƒƒdSg}| d¡} |dkrD|d7}|d7}|j|} } t| ƒD]ø\} } t| ƒ}| t| ƒdkr‚| |8} t|ƒ| krš| |¡qZt d| ¡}|s®J‚|drºJ‚|  ¡| }d}t|ƒD]l\}}||}|t|ƒdk�r| t| ƒdk�r||8}tt|ƒƒ|k�r:|�r4| t|ƒ¡|}qÒ|}qÒ|rZ| t|ƒ¡qZt|ƒdk�rn||ƒdS|dk�r€|dƒt|ƒD],\} }| dk�rª|dd |ƒ||ƒ�qˆ|dk�rÈ|d ƒdS) NTr z\S*\s*éÿÿÿÿÚrarr9rYrb) r;rJrcÚ splitlinesr2Ú enumerateÚappendÚreÚfindallÚpop)rrrrrQrRrSr;ÚchunksÚlinesZ max_width1rVÚiÚlinerUÚpartsZ max_width2ÚcurrentÚjÚpartÚ candidaterrrÚ _pprint_strsX      $    zPrettyPrinter._pprint_strc Cs’|j}t|ƒdkr"|t|ƒƒdS|dk}|rF|d7}|d7}|dƒd} t||j||ƒD]$} || ƒ|| ƒ| s\dd|} q\|rŽ|dƒdS)Nér rarur9rYrb)r;rJrcÚ_wrap_bytes_reprr2) rrrrrQrRrSr;ZparensÚdelimrUrrrÚ _pprint_bytes3s"  zPrettyPrinter._pprint_bytesc Cs>|j}|dƒ| t|ƒ||d|d||d¡|dƒdS)Nz bytearray(é r rb)r;r‰Úbytes)rrrrrQrRrSr;rrrÚ_pprint_bytearrayHs ÿzPrettyPrinter._pprint_bytearraycCs8| d¡| | ¡||d|d||¡| d¡dS)Nz mappingproxy(é r rb)r;r:ÚcopyrkrrrÚ_pprint_mappingproxyQs  ÿz"PrettyPrinter._pprint_mappingproxyc CsÒt|ƒtjurd}n|jj}|t|ƒd7}dd|}|j ¡} t| ƒd} | |d¡t | ƒD]^\} \} } | | ¡| d¡| | k}|  | ||t| ƒd|rª|nd||¡|sd| |¡qd| d¡dS)NÚ namespacer ú, rYraú=rb) r#Ú_typesÚSimpleNamespacerdr'rJÚ__dict__r^r;rwr:)rrrrrQrRrSÚcls_nameÚdelimnlr^Ú last_indexr~r[ÚentÚlastrrrÚ_pprint_simplenamespaceYs&      þ z%PrettyPrinter._pprint_simplenamespacec Csœ|j}||j7}dd|}t|ƒd} t|ƒD]f\} \} } | | k} | | ||¡}||ƒ|dƒ| | ||t|ƒd| r€|nd||¡| s0||ƒq0dS)Nr‘rYr z: r)r;r1rJrwrIr:)rr^rrrQrRrSr;r—r˜r~r[r™ršrUrrrr_ts    þz PrettyPrinter._format_dict_itemscCsH|j}||j7}|jdkr,||jddƒdd|}d} |j|d} } t|ƒ} z t| ƒ} WntyvYdS0d}|�sD| }z t| ƒ} Wn&ty¸d}| |8} | |8} Yn0|j�r| |||¡}t|ƒd}| |krð| } | rð|} | |k�r| |8} || ƒd} ||ƒq||| ƒ|} |  ||||�r8|nd||¡q|dS) Nr rYr‘ruFTrú, ) r;r1r2ÚiterÚnextÚ StopIterationr7rIrJr:)rr^rrrQrRrSr;r—rˆrrVÚitZnext_entršr™rUÚwrrrrj…sP           þzPrettyPrinter._format_itemscCs4| || ¡|j|¡\}}}|s&d|_|r0d|_|S)NFT)rBrŽr0rHrG)rrrRrSrcrDrErrrrI®s ÿ zPrettyPrinter._reprcCst|||||jƒS)zÈFormat object for a specific context, returning a string and flags indicating whether the representation is 'readable' and whether the object represents a recursive construct. )rr8)rrrRÚ maxlevelsrSrrrrB·szPrettyPrinter.formatc Cs‚t|ƒs| t|ƒ¡dS| |j||¡}|j}|t|jƒd7}| d|j|d|f¡| ||||d||¡| d¡dS)Nr z %s(%s, %srYrb)rJr;rcrIÚdefault_factoryrdr'rP) rrrrrQrRrSZrdfrfrrrÚ_pprint_default_dict¾sz"PrettyPrinter._pprint_default_dictc CsŠt|ƒs| t|ƒ¡dS|j}| |jd¡|jdkrN| |jdd¡| ¡}| |||t|jƒd|d||¡| d¡dS)Nror rYrrp)rJr;rcrdr'r1Ú most_commonr_) rrrrrQrRrSrfr^rrrÚ_pprint_counterËs þzPrettyPrinter._pprint_counterc Cs¸t|jƒs| t|ƒ¡dS|j}| |jd¡|t|jƒd7}t|jƒD]d\}} |t|jƒdkrŒ| | |||d||¡| d¡qN| | ||d||¡| dd|¡qNdS)Nrar rbr‘rY)rJÚmapsr;rcrdr'rwr:) rrrrrQrRrSrfr~ÚmrrrÚ_pprint_chain_mapÛs  zPrettyPrinter._pprint_chain_mapc Cs¸t|ƒs| t|ƒ¡dS|j}| |jd¡|t|jƒd7}| d¡|jdurz| ||||d||¡| d¡n:| |||d||¡| |j||¡}| dd||f¡dS)Nrar rhrz])z], %smaxlen=%s)rY)rJr;rcrdr'ÚmaxlenrjrI) rrrrrQrRrSrfZrmlrrrÚ _pprint_dequeìs"  ÿ  ÿzPrettyPrinter._pprint_dequec Cs| |j|||||d¡dS©Nr ©r:ÚdatarkrrrÚ_pprint_user_dictszPrettyPrinter._pprint_user_dictc Cs| |j|||||d¡dSr¬r­rkrrrÚ_pprint_user_listszPrettyPrinter._pprint_user_listc Cs| |j|||||d¡dSr¬r­rkrrrÚ_pprint_user_string sz!PrettyPrinter._pprint_user_string)r r NN)4r'r(r)r rrrrr:rKrPrOrMrgÚ _collectionsÚ OrderedDictrlrernÚtuplersrqÚ frozensetr…r"r‰r‹rŒÚ bytearrayr�r“ÚMappingProxyTyper›r”r_rjrIrBr¤Ú defaultdictr¦ÚCounterr©ÚChainMapr«Údequer¯ÚUserDictr°ÚUserListr±Ú UserStringrrrrrgs`ÿ +      1     )       rcCsŽt|ƒ}|tvrt|ƒddfSt|ddƒ}t|tƒ�rD|tju�rD|sJdSt|ƒ}|rl||krldd||vfS||vr‚t|ƒddfSd||<d}d} g} | j } |d7}|rºt |  ¡t d�} n|  ¡} | D]b\} }t | ||||ƒ\}}}t |||||ƒ\}}}| d||fƒ|�o|�o|}|�s$|rÆd} qÆ||=d d  | ¡|| fSt|tƒ�r\|tju�stt|tƒ�rn|tju�rnt|tƒ�r�|�sŠd Sd }n"t|ƒdk�r¤d }n|�s®dSd}t|ƒ}|�rÜ||k�rÜ|dd||vfS||v�rôt|ƒddfSd||<d}d} g} | j } |d7}|D]8}t |||||ƒ\}}}| |ƒ|�sFd}|�rd} �q||=|d  | ¡|| fSt|ƒ}||�oˆ| d¡ dfS)NTFrM)z{}TFz{...}r rZz%s: %sz{%s}rœ)z[]TFz[%s]z(%s,))z()TFz(%s)z...ú<)r#Ú_builtin_scalarsrcÚgetattrÚ issubclassrOrMr$rFrxr]r^r-rÚjoinrer´rJÚ startswith)rrRr¢rSrrrÚrrTrDrEÚ componentsrxr^ÚkÚvZkreprZ kreadableZkrecurZvreprZ vreadableZvrecurrBÚoZoreprZ oreadableZorecurrUrrrrs„    ÿÿ  rcCsdt|ƒjt|ƒfS)Nz)r#r'r$rrrrrFZsÿrFcCs„ddl}|dur,ddddgdddœfgd }tƒ}| ¡}t|iddd ƒ| ¡}| |¡| ¡}td ||ƒtd ||ƒdS) NrÚstring)r rér†éé)ééi †Tz _safe_repr:zpformat:)ÚtimerÚ perf_counterrrÚprint)rrÐrWÚt1Út2Zt3rrrÚ _perfcheck_s rÕccsŒd}t|ƒdd}tdt|ƒdƒD]T}|||d…}||}||krP||8}tt|ƒƒ|krt|rnt|ƒV|}q$|}q$|rˆt|ƒVdS)Nór†r)rJÚrangerc)rrrQr�ršr~rƒr„rrrr‡ls r‡Ú__main__)Nr r N)r r N)N)$r*Ú collectionsr²ryÚsysr4Útypesr“Úiorr>Ú__all__rrr rrrrr-rrrµr"r‹r¶r.ÚfloatÚcomplexr6r#rÀrFrÕr‡r'rrrrÚ s> ÿ ÿ -Fÿ