
    i
                         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mZ  e	j                  d       ed	d
       e ej                         ddd      fdedefd       ZdedefdZdefdZy)    )Path)msg   )load_project_configlogger   )Argapp)RemoteStorageget_command_hashget_content_hashpushdefaultzName or path of remote storage)helpzELocation of project directory. Defaults to current working directory.TF)r   exists	file_okayremoteproject_dirc                     t        ||       D ];  \  }}|t        j                  d|        !t        j                  d| d|        = y)aU  Persist outputs to 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_up-push
    Nz	Skipping zPushed z to )project_pushr   infogood)r   r   output_pathurls       `/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/weasel/cli/push.pyproject_push_clir   
   sP     )f= 7S;HHy./HHw{m4u56	7    c           
   #     K   t        |       }||j                  di       v r|d   |   }t        | |      }|j                  dg       D ]&  }t        j                  d|d          |j                  dg       D cg c]  }| |z  	 }}t        d |D              rt        j                  d|d          kt        dd|j                  dg       D cg c]  }| |z  	 c}|d	         }t        j                  d
|       |j                  dg       D ]_  }| |z  }	|	j                         st        |	      s%|j                  ||t        |	            }
t        j                  d|
||       ||
f a ) yc c}w c c}w w)zPersist outputs to 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. gcs, aws, ssh, local directories etc
    remotescommandszCMD: %snamedepsc              3   >   K   | ]  }|j                            y wN)r   ).0deps     r   	<genexpr>zproject_push.<locals>.<genexpr>+   s     0C3::<0s   z'Dependency missing. Skipping %s outputs scriptzCMD_HASH: %soutputs)command_hashcontent_hashz&URL: %s for output %s with cmd_hash %sN)r   getr   r   debuganyr   r   _is_not_empty_dirr   r   )r   r   configstoragecmdr&   r"   cmd_hashr   
output_locr   s              r   r   r      s|    
 !-FIr**	"6*K0Gzz*b) 'YF,-0WWVR-@Acc!AA0400LLBCKP##''&"2EF3[3&FH
 	^X.779b1 	'K${2J  "'8'Dll!)!1*!= # 
 <c;PX "3&&	''A
 Gs-   A7E=9E3A	E=E8AE=&E=2AE=locc                 h    | j                         syt        d | j                         D              ryy)NTc              3   2   K   | ]  }t        |        y wr$   )r0   )r%   childs     r   r'   z$_is_not_empty_dir.<locals>.<genexpr>C   s     A%u%As   F)is_dirr/   iterdir)r6   s    r   r0   r0   @   s(    ::<	A3;;=A	Ar   N)pathlibr   wasabir   utilr   r   mainr	   r
   remote_storager   r   r   commandcwdstrr   r   r0    r   r   <module>rE      s      .  M M V i&FGHDHHJ-t  ~B  NS  T77 7 7('d 'C 'B4 r   