grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026 й¼]5{ã @s:ddgZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddlmZyddlZWn'ek rÝejZdd„ZYnXdd „Zd d„Zd d „Zd ZejdƒZGdd„dƒZdd„Zdd„ZGdd„dƒZdd„Zdd„Zddd„Z dd„Z!Gdd„dƒZ"dd „Z#dd!d"„Z$d#d$„Z%Gd%d&„d&eƒZ&d'd(„Z'd)d*„Z(d+d,„Z)d-d.„Z*dd/d0„Z+d1d2„Z,e-d3kr6e$ƒdS)4ÚTraceÚCoverageResultséN)Úwarn)Ú monotoniccCstjdƒdS)N)ÚsysÚsettrace©rrú*/opt/alt/python35/lib64/python3.5/trace.pyÚ _unsettraceEsr cCstj|ƒtj|ƒdS)N)Ú threadingrr)Úfuncrrr Ú _settraceHs r cCstjdƒtjdƒdS)N)rrr rrrr r Ls cCs|jdtjdƒdS)Na Usage: %s [OPTIONS] [ARGS] Meta-options: --help Display this help then exit. --version Output version information then exit. Otherwise, exactly one of the following three options must be given: -t, --trace Print each line to sys.stdout before it is executed. -c, --count Count the number of times each line is executed and write the counts to .cover for each module executed, in the module's directory. See also `--coverdir', `--file', `--no-report' below. -l, --listfuncs Keep track of which functions are executed at least once and write the results to sys.stdout after the program exits. -T, --trackcalls Keep track of caller/called pairs and write the results to sys.stdout after the program exits. -r, --report Generate a report from a counts file; do not execute any code. `--file' must specify the results file to read, which must have been created in a previous run with `--count --file=FILE'. Modifiers: -f, --file= File to accumulate counts over several runs. -R, --no-report Do not generate the coverage report files. Useful if you want to accumulate over several runs. -C, --coverdir= Directory where the report files. The coverage report for . is written to file //.cover. -m, --missing Annotate executable lines that were not executed with '>>>>>> '. -s, --summary Write a brief summary on stdout for each file. (Can only be used with --count or --report.) -g, --timing Prefix each line with the time since the program started. Only used while tracing. Filters, may be repeated multiple times: --ignore-module= Ignore the given module(s) and its submodules (if it is a package). Accepts comma separated list of module names --ignore-dir= Ignore files in the given directory (multiple directories can be joined by os.pathsep). r)ÚwriterÚargv)Úoutfilerrr Ú_usagePs*rz#pragma NO COVERz ^\s*(#.*)?$c@s.eZdZdddd„Zdd„ZdS)Ú_IgnoreNcCsS|stƒn t|ƒ|_|s*gndd„|Dƒ|_ddi|_dS)NcSs"g|]}tjj|ƒ‘qSr)ÚosÚpathÚnormpath)Ú.0Údrrr ú …s z$_Ignore.__init__..zé)ÚsetÚ_modsÚ_dirsÚ_ignore)ÚselfÚmodulesÚdirsrrr Ú__init__ƒs z_Ignore.__init__cCsÛ||jkr|j|S||jkr:d|j|r@r?rÚfÚerrrrr r!Øs,          zCoverageResults.__init__cCs|jdƒo|jdƒS)Nú<ú>)r#Úendswith)rr%rrr Úis_ignored_filenameòsz#CoverageResults.is_ignored_filenamec CsŸ|j}|j}|j}|j}|j}|j}x,|D]$}|j|dƒ||||r?Úget) rÚotherr<r>r?Z other_countsZother_calledfuncsZ other_callersÚkeyrrr rDøs       "  zCoverageResults.updateTFc!CsÚ|jrZtƒtdƒ|j}x4t|ƒD]&\}}}td|||fƒq0W|jr$tƒtdƒd}} x£t|jƒD]’\\} } } \} }}| |krÛtƒtd| dƒ| }d} | | kr| | krtd| ƒ| } td| | ||fƒqŽWi}xH|jD]=\}}|j|iƒ}||<|j||f||z %s.%s -> %s.%sz.pycrz.coverr:édzlines cov% module (path)z%5d %3d%% %s (%s)Úwbz"Can't save counts files because %sr;éÿÿÿÿ)!r>rIÚsortedr?r<rQÚitemsrPrOrrÚdirnameÚabspathr0ÚexistsÚmakedirsr9Ú_find_executable_linenosÚ linecacheÚgetlinesÚjoinrAÚtokenizeÚdetect_encodingÚreadlineÚwrite_results_fileÚintrrBÚdumprFrrJ)!rZ show_missingÚsummaryÚcoverdirZcallsr%r&ÚfuncnameZlastfileZ lastcfileZpfileZpmodZpfuncÚcfileZcmodZcfuncZper_fileÚlinenoÚ lines_hitZsumsÚcountr8ÚlnotabÚsourceZ coverpathÚfpÚencodingÚ_Ún_hitsÚn_linesÚpercentÚmrLrrr Ú write_results s~      +          zCoverageResults.write_resultsc CsRyt|dd|ƒ}WnFtk ra}z&td||fdtjƒd SWYdd}~XnXd}d} |�ÑxÉt|dƒD]¸\} } | |krÉ|jd|| ƒ| d7} |d7}n^tj| ƒrè|jdƒn?| |krt | kr|jd ƒ|d7}n |jdƒ|j| j d ƒƒq…WWdQRX| |fS) NÚwrqz2trace: Could not open %r for writing: %s- skippingr;rrz%5d: z z>>>>>> é)rr) rArFrIrrJÚ enumeraterÚrx_blankÚmatchÚPRAGMA_NOCOVERÚ expandtabs) rrÚlinesrnrlrqrrLrtrsrkÚlinerrr rd`s,      !z"CoverageResults.write_results_file)r)r*r+r!rPrDrwrdrrrr r×s    VcCs@i}x3tj|ƒD]"\}}||krd||.rcSs%g|]}t|tƒr|‘qSr)Ú isinstancer±)rrrrr r#s rcSs%g|]}t|dƒr|‘qS)Ú __bases__)Úhasattr)rr‰rrr r&s z%s.%s) Úf_codeÚ co_filenamer0Úco_namer�ÚgcZ get_referrersr3r)) rÚframer‚r%r&riZclsnameZfuncsZdictsÚclassesrrr Úfile_module_function_of s,         zTrace.file_module_function_ofcCsD|dkr@|j|ƒ}|j|jƒ}d|j||fr?)rr<r@rr›rœ)rrrr Úresults„s  z Trace.results)r)r*r+r!r²r¯r¸rÂr r¢r£r¤r¦r§rÎrrrr r¾s   0  )   cCs2tjjdtjd|fƒtjdƒdS)Nz%s: %s rr)rrJrrÚexit)Úmsgrrr Ú _err_exitŠs!rÑc#Cs,ddl}|dkr!tj}yV|j|dd…ddddddd d d d d dddddgƒ\}}Wnq|jk rê}zNtjjdtjd|fƒtjjdtjdƒtjdƒWYdd}~XnXd}d}d}d}d} d} g} g} d} d}d}d}d}x×|D]Ï\}}|dkrrttjƒtjdƒ|dkr›tjjdƒtjdƒ|dks³|dkr¼d}q@|dksÔ|dkrÝd}q@|dksõ|dkrþd}q@|d ks|d!krd}q@|d"ks7|d#kr@d}q@|d$ksX|d%krad}q@|d&ksy|d'kr‚d}q@|d(ksš|d)kr£|} q@|d*ks»|d+krÄd} q@|d,ksÜ|d-krå|} q@|d.ksý|d/krd}q@|d0krBx*|j d1ƒD]}| j |j ƒƒq"Wq@|d2kr@x»|j t j ƒD]§}t jj|ƒ}|jd3t jjtjd4d5tjdd6…ƒƒ}|jd7t jjtjd4d5tjdd6…ƒƒ}t jj|ƒ}| j |ƒqaWq@q@W|r/|s%|r/td8ƒ|pJ|pJ|pJ|pJ|sWtd9ƒ|rm|rmtd:ƒ|r„| r„td;ƒ|r¦t|ƒdkr¦td<ƒ|rÝtd=| d>| ƒ}|j| d |d?| ƒnK|t_|d}t jj |ƒdtjd| d|ƒ}yct|ƒ�}t|jƒ|dDƒ}WdQRXdE|dFdGdHddIdi}|j|||ƒWnQtk rë}z tdJtjd|fƒWYdd}~Xnt k rüYnX|j!ƒ}|s(|j| d |d?| ƒdS)KNrrztcrRf:d:msC:lTgÚhelpÚversionršrmÚreportz no-reportrgzfile=Úmissingzignore-module=z ignore-dir=z coverdir=Ú listfuncsZ trackcallsr¬z%s: %s z%Try `%s --help' for more information Fz--helpz --versionz trace 2.0 z-Tz --trackcallsTz-lz --listfuncsz-gz--timingz-tz--tracez-cz--countz-rz--reportz-Rz --no-reportz-fz--filez-mz --missingz-Cz --coverdirz-sz --summaryz--ignore-moduleú,z --ignore-dirz$prefixÚlibÚpythonéz $exec_prefixz8cannot specify both --listfuncs and (--trace or --count)zLmust specify one of --trace, --count, --report, --listfuncs, or --trackcallsz,cannot specify both --report and --no-reportz--report requires a --filezmissing name of file to runr@rrhr¨r©rªr«r”rÈr)r­Ú __package__Ú __cached__zCannot run file %r because: %s)"ÚgetoptrrÚerrorrJrrÏrÚstdoutÚsplitÚappendÚstriprÚpathseprÚ expandvarsr5r`Ú base_prefixrÓÚbase_exec_prefixrrÑr3rrwrrAr–r•r¯rFÚ SystemExitrÎ)rrÝZoptsZ prog_argvrÐršrmrÔZ no_reportZ counts_filerÕZignore_modulesZ ignore_dirsrhrgrÖr©r¬ÚoptÚvalr'ÚsrÎZprognameÚtrpr‚ZglobsrLrrr ÚmainŽsò     !                       -  rìcCstdtdƒt|ƒdS)Nz(The trace.usage() function is deprecatedé)Ú_warnÚDeprecationWarningr)rrrr Úusage.s rðc@s"eZdZdddd„ZdS)ÚIgnoreNcCs'tdtdƒtj|||ƒdS)Nz$The class trace.Ignore is deprecatedrí)rîrïrr!)rrr rrr r!4s zIgnore.__init__)r)r*r+r!rrrr rñ3s rñcCstdtdƒt|ƒS)Nz*The trace.modname() function is deprecatedrí)rîrïr0)rrrr Úmodname9s ròcCstdtdƒt|ƒS)Nz.The trace.fullmodname() function is deprecatedrí)rîrïr9)rrrr Ú fullmodname>s rócCstdtdƒt||ƒS)Nz7The trace.find_lines_from_code() function is deprecatedrí)rîrïr…)r‚rƒrrr Úfind_lines_from_codeCs rôcCstdtdƒt||ƒS)Nz-The trace.find_lines() function is deprecatedrí)rîrïrˆ)r‚rƒrrr Ú find_linesHs rõcCs tdtdƒt|ddƒS)Nz/The trace.find_strings() function is deprecatedrírq)rîrïr“)r%rqrrr Ú find_stringsMs röcCstdtdƒt|ƒS)Nz:The trace.find_executable_linenos() function is deprecatedrí)rîrïr])r%rrr Úfind_executable_linenosRs r÷r­).Ú__all__r^rÚrerrŠrar‡r¿r�rBÚwarningsrrîÚtimerrŸr Ú ImportErrorrr r rr}r–r{rr0r9rr…rˆr“r]rrÑrìrðrñròrórôrõrör÷r)rrrr Ú2sV                -2  ¬  Ì