U
    aÊ¹jŽ	  ã                   @   sp   d Z ddlZddlZddlmZ ddlmZ ddlm	Z	 dd„ Z
d	d
„ Zefdd„Zddd„Zejeed�ZdS )z2Timestamp comparison of files and groups of files.é    N)Úsplaté   )Ú
zip_strict)ÚDistutilsFileErrorc                 C   s&   t j |¡ p$t j | ¡t j |¡kS ©N)ÚosÚpathÚexistsÚgetmtime©ÚsourceÚtarget© r   ú^/var/www/html/bwave/python/venv/lib/python3.8/site-packages/setuptools/_distutils/_modified.pyÚ_newer   s    ÿr   c                 C   s.   t j | ¡s$tdt j | ¡› d�ƒ‚t| |ƒS )zÛ
    Is source modified more recently than target.

    Returns True if 'source' is modified more recently than
    'target' or if 'target' does not exist.

    Raises DistutilsFileError if 'source' does not exist.
    zfile 'z' does not exist)r   r   r	   r   Úabspathr   r   r   r   r   Únewer   s    	r   c                 C   s.   t t|ƒt| |ƒƒ}tttt|Ž ƒƒp,g g fS )a1  
    Filter filenames where sources are newer than targets.

    Walk two filename iterables in parallel, testing if each source is newer
    than its corresponding target.  Returns a pair of lists (sources,
    targets) where source is newer than target, according to the semantics
    of 'newer()'.
    )Úfilterr   r   ÚtupleÚmapÚlistÚzip)ÚsourcesÚtargetsr   Znewer_pairsr   r   r   Únewer_pairwise!   s    	r   Úerrorc                    sL   ‡ fdd„‰ˆ dkrt jjnd}t j ˆ¡ pJt‡‡fdd„t|| ƒD ƒƒS )aÛ  
    Is target out-of-date with respect to any file in sources.

    Return True if 'target' is out-of-date with respect to any file
    listed in 'sources'. In other words, if 'target' exists and is newer
    than every file in 'sources', return False; otherwise return True.
    ``missing`` controls how to handle a missing source file:

    - error (default): allow the ``stat()`` call to fail.
    - ignore: silently disregard any missing source files.
    - newer: treat missing source files as "target out of date". This
      mode is handy in "dry-run" mode: it will pretend to carry out
      commands that wouldn't work because inputs are missing, but
      that doesn't matter because dry-run won't run the commands.
    c                    s   ˆ dkot j | ¡ S )Nr   )r   r   r	   )r   )Úmissingr   r   Úmissing_as_newer?   s    z%newer_group.<locals>.missing_as_newerÚignoreNc                 3   s    | ]}ˆ |ƒpt |ˆƒV  qd S r   )r   )Ú.0r   )r   r   r   r   Ú	<genexpr>C   s   ÿznewer_group.<locals>.<genexpr>)r   r   r	   Úanyr   )r   r   r   Zignoredr   )r   r   r   r   Únewer_group.   s
    þr"   )r   )r   )Ú__doc__Ú	functoolsÚos.pathr   Zjaraco.functoolsr   Zcompat.py39r   Úerrorsr   r   r   r   r"   ÚpartialZnewer_pairwise_groupr   r   r   r   Ú<module>   s   
