
    yIf                    f    d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl	m
Z
 e
rd dlmZ ddZdS )    )annotationsN)chain)
commonpath)TYPE_CHECKING)Pathpackager   	temp_pathreturnc                   |                     dd           d |                                D             }t          t          dd |D                                 }|t	          |dz             z  }|                                  || j        z  }d}t          t          d          r0	 t          j        | |           d}n# t          t          f$ r Y nw xY w|st          j        | |           |rd	nd
}t          || f          }|                    |          |                     |          }
}	t          j        d|	||
|           |S )z_Allows using the file after you no longer holding a lock to it by moving it into a temp folder.T)parentsexist_okc                    g | ]	}|j         
S  )name.0is     F/var/www/piapp/venv/lib/python3.11/site-packages/tox/util/file_view.py
<listcomp>z'create_session_view.<locals>.<listcomp>   s    222af222    )r   c              3  v   K   | ]4}t          |                                          #t          |          V  5d S )N)str	isnumericintr   s     r   	<genexpr>z&create_session_view.<locals>.<genexpr>   s?      LL!Q9I9I9K9KLs1vvLLLLLLr      Flinklinkscopiedzpackage %s %s to %s (%s))mkdiriterdirmaxr   r   r   hasattrosr   OSErrorNotImplementedErrorshutilcopyfiler   relative_tologgingdebug)r   r	   existsfile_idsession_dirsession_packager   	operationcommonrel_sessionrel_packages              r   create_session_viewr4      sn    OOD4O00022i//11222F%LLvLLLMMNNGc'A+...K!GL0OEr6 	GG_---EE,- 	 	 	D	 2111 .hI'233F.::6BBGDWDWX^D_D_KM,k9kSYZZZs   (C   CC)r   r   r	   r   r
   r   )
__future__r   r*   r$   r'   	itertoolsr   os.pathr   typingr   pathlibr   r4   r   r   r   <module>r:      s    " " " " " "  				                               r   