'}dZddlmZddlZddlZddlZddlmZm Z m Z m Z m Z ddl mZmZddlmZddlmZmZmZmZddlmZd&d'dZd(dZd)d*dZ d+d,d"Zd-d#Zd.d%ZdS)/aCoverage data for coverage.py. This file had the 4.x JSON data support, which is now gone. This file still has storage-agnostic helpers, and is kept to avoid changing too many imports. CoverageData is now defined in sqldata.py, and imported here to keep the imports working. ) annotationsN)CallableDictIterableListOptional)CoverageException NoDataError) PathAliases)Hasher file_be_gone human_sortedplural) CoverageDataFdatarfullpathboolreturnDict[str, int]ci}|rd}ntjj}|D]6}||}|Jt ||||<7|S)aHReturn a dict summarizing the line coverage data. Keys are based on the file names, and values are the number of executed lines. If `fullpath` is true, then the keys are the full pathnames of the files, otherwise they are the basenames of the files. Returns a dict mapping file names to counts of lines. c|SN)fs /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/coverage/data.pyzline_counts..)s)ospathbasenamemeasured_fileslineslen)rrsumm filename_fnfilenamer"s r line_countsr's~ D'!k g& ''))11 8$$   &)%jj[[ " "## Krr&strhasherr Nonec4|r8|t||pgn#|t |||||dS)zContribute `filename`'s data to the `hasher`. `hasher` is a `coverage.misc.Hasher` instance to be updated with the file's data. It should only get the results data, not the run data. N)has_arcsupdatesortedarcs sorted_lines file_tracer)rr&r)s radd_data_to_hashr23s }}4 fTYYx006B778888 l422333 MM$""8,,-----r data_file data_pathsOptional[Iterable[str]] List[str]ctjtj|\}}|p|g}g}|D]}tj|r3|tj|Ttj|rztjtj tj||dz}| tj|td|d|S)zMake a list of data files to be combined. `data_file` is a path to a data file. `data_paths` is a list of files or directories of files. Returns a list of absolute file paths. z.*z)Couldn't combine from non-existent path '') rrsplitabspathisfileappendisdirglobescapejoinextendr )r3r4data_dirlocalfiles_to_combineppatterns rcombinable_filesrGBsgmmBGOOI$>$>??OHe)zJ PP 7>>!   P  # #BGOOA$6$6 7 7 7 7 W]]1   Pk"',,rwq/A/A5"I"IJJDPG  # #DIg$6$6 7 7 7 7N!NNNOO O raliasesOptional[PathAliases]strictkeepmessageOptional[Callable[[str], None]]cjt||}|r|stdt}d}|D]T} | |kr8|jdr|jd| S tj | } n#t$r| } YnwxYwt| d5} tjd} | | | } | |v}dddn #1swxYwY| }|r|jdr|jd| ||  t'| |j }|||| d }|r|d | ne#t($rH}|jr"|t-||r|d | d|d}Yd}~nd}~wwxYw|r|d| |rF|jdr|jd| t/| V|r|stddSdS)aCombine a number of data files together. `data` is a CoverageData. Treat `data.filename` as a file prefix, and combine the data from all of the data files starting with that prefix plus a dot. If `aliases` is provided, it's a `PathAliases` object that is used to re-map paths to match the local machine's. If `data_paths` is provided, it is a list of directories or files to combine. Directories are searched for files that start with `data.filename` plus dot as a prefix, and those files are combined. If `data_paths` is not provided, then the directory portion of `data.filename` is used as the directory to search for data files. Unless `keep` is True every data file found and combined is then deleted from disk. If a file cannot be read, a warning will be issued, and the file will not be deleted. If `strict` is true, and no files are found to combine, an error is raised. `message` is a function to use for printing messages to the user. zNo data to combineFdataiozSkipping combining ourself: rbsha3_256NzCombining data file )debug)rHTzCombined data file zCouldn't combine data file : zSkipping duplicate data zDeleting data file zNo usable data files)rG base_filenamer set data_filename_debugshouldwriterrrelpath ValueErroropenhashlibnewr-readdigestaddrr _warnr(r )rrHr4rJrKrLrD file_hashes combined_anyr rel_file_namefobjr)shacombine_this_onedelete_this_onenew_dataexcs rcombine_parallel_datarlYsvF((:(:(<(">">??? OOC  C'===  Hg 666# CGA-AABBB% ( ( (:)JJs3xx(((RGP-PP3PPQQQ"' ( DB=BBCCC  {!!(++ ? !!"="="=>>> OOO 2l201112222s=B<< C  C AD>>E E *G// I9>H<<Ic t|}|}td|tj|stddS|td|t|d}t| }t|}t|dt|d|D]T}|d ||d t||}| |}|r |d |d z }t|UdS) z(Implementation of 'coverage debug data'.zpath: z%No data collected: file doesn't existNz has_arcs: T)rz file:rSz linez [])rrVprintrrexistsr_r,r'rkeysr#rr1)r&rsummary filenamesnfilesrlineplugins rdebug_data_filerxsb  ! !D!!##H 8   7>>( # # 5666IIKKK *t}} * *+++$...GW\\^^,,I ^^F V + +&.. + + +,,, <r]os.pathrtypingrrrrrcoverage.exceptionsr r coverage.filesr coverage.miscr r rrcoverage.sqldatarr'r2rGrlrxr0rrrrsp#""""" ;;;;;;;;;;;;;;>>>>>>>>&&&&&&DDDDDDDDDDDD))))))0 . . . .2&**./3 `2`2`2`2`2F,r