
    iv                         d dl mZ d dlmZ ddlmZmZ ddlmZm	Z	 ddl
mZmZ ddlmZ  e	j                  d	       ed
d       e ej                          ddd      fdedefd       ZdddededefdZy)    )Path)msg   )load_project_configlogger   )Argapp)RemoteStorageget_command_hash)update_lockfilepulldefaultzName or path of remote storage)helpzELocation of project directory. Defaults to current working directory.TF)r   exists	file_okayremoteproject_dirc                 h    t        ||       D ]#  \  }}|	t        j                  d| d|        % y)ap  Retrieve available precomputed outputs from a remote storage.
    You can alias remotes in your project.yml by mapping them to storage paths.
    A storage can be anything that the smart_open library can upload to, e.g.
    AWS, Google Cloud Storage, SSH, local directories etc.

    DOCS: https://github.com/explosion/weasel/tree/main/docs/cli.md#arrow_down-push
    NzPulled z from )project_pullr   good)r   r   urloutput_paths       `/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/weasel/cli/pull.pyproject_pull_clir      s=     )f= 9[?HHw{m6#789    )verboser   c             #   .  K   t        |       }||j                  di       v r|d   |   }t        | |      }t        |j                  dg             }|r6t	        t        |            D ]  \  }}t        j                  d|d          |j                  dg       D cg c]  }| |z  	 }	}t        d |	D              rt        dd|	|d         }
|j                  d	g       D ]3  }|j                  ||

      }t        j                  d|||
       ||f 5 |j                  d	g       D cg c]  }| |z  	 }}t        d |D              rt        | |       |j                  |        nt        j                  d|d           y |r5y y c c}w c c}w w)NremotescommandszCMD: %s.namedepsc              3   <   K   | ]  }|j                           y wNr   ).0deps     r   	<genexpr>zproject_pull.<locals>.<genexpr>-   s     0C3::<0    scriptoutputs)command_hashz#URL: %s for %s with command hash %sc              3   <   K   | ]  }|j                           y wr$   r%   )r&   locs     r   r(   zproject_pull.<locals>.<genexpr>:   s     8szz|8r)   z(Dependency missing. Skipping %s outputs.)r   getr   list	enumerater   debugallr   r   r   pop)r   r   r   configstorager    icmdr'   r"   cmd_hashr   r   outout_locss                  r   r   r      s     !-FIr**	"6*K0GFJJz2./H X/ 	FAsLLS[1141DE#K#%EDE0400+BD#h-H#&779b#9 +K!,,{,JCLL=# 	 {**+ :=B9OP#K#-PP8x88#K5 QGVU/	4 7  F Qs&   BFF(BF)F5AF	FN)pathlibr   wasabir   utilr   r   mainr	   r
   remote_storager   r   runr   commandcwdstrr   boolr    r   r   <module>rH      s      .  ;   V i&FGHDHHJ-t  ~B  NS  T99 9 9$ EJ &d &C &T &r   