Ë
    Q^(h;  ã                   ó–   — d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	 ddl
mZ  ej                  e«      Z G d„ d«      Z G d	„ d
e	«      Zy)a©  Contains command to update or delete files in a repository using the CLI.

Usage:
    # delete all
    huggingface-cli repo-files <repo_id> delete "*"

    # delete single file
    huggingface-cli repo-files <repo_id> delete file.txt

    # delete single folder
    huggingface-cli repo-files <repo_id> delete folder/

    # delete multiple
    huggingface-cli repo-files <repo_id> delete file.txt folder/ file2.txt

    # delete multiple patterns
    huggingface-cli repo-files <repo_id> delete file.txt "*.json" "folder/*.parquet"

    # delete from different revision / repo-type
    huggingface-cli repo-files <repo_id> delete file.txt --revision=refs/pr/1 --repo-type=dataset
é    )Ú_SubParsersAction)ÚListÚOptional)Úlogging)ÚBaseHuggingfaceCLICommand)ÚHfApic                   ó   — e Zd Zdd„Zdd„Zy)ÚDeleteFilesSubCommandNc                 óZ  — || _         |j                  | _        |j                  | _        |j                  | _        t	        |j
                  d¬«      | _        |j                  | _        |j                  | _        |j                  | _	        |j                  | _
        |j
                  | _        y )Nzhuggingface-cli)ÚtokenÚlibrary_name)ÚargsÚrepo_idÚ	repo_typeÚrevisionr   r   ÚapiÚpatternsÚcommit_messageÚcommit_descriptionÚ	create_pr)Úselfr   s     úa/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/huggingface_hub/commands/repo_files.pyÚ__init__zDeleteFilesSubCommand.__init__1   sz   € ØˆŒ	Ø ŸL™LˆŒØ(,¯©ˆŒØ'+§}¡}ˆŒÜ d§j¡jÐ?PÔQˆŒØ#'§=¡=ˆŒØ-1×-@Ñ-@ˆÔØ15×1HÑ1HˆÔØ#Ÿ~™~ˆŒØ$(§J¡Jˆ�
ó    c           	      óB  — t        j                  «        | j                  j                  | j                  | j
                  | j                  | j                  | j                  | j                  | j                  ¬«      }t        d|› d�«       t        j                  «        y )N)Údelete_patternsr   r   r   r   r   r   z+Files correctly deleted from repo. Commit: ú.)r   Úset_verbosity_infor   Údelete_filesr   r   r   r   r   r   r   ÚprintÚset_verbosity_warning)r   Úurls     r   ÚrunzDeleteFilesSubCommand.run=   s|   € Ü×"Ñ"Ô$Ø�h‰h×#Ñ#Ø ŸM™MØ—L‘LØ—n‘nØ—]‘]Ø×.Ñ.Ø#×6Ñ6Ø—n‘nð $ó 
ˆô 	Ð;¸C¸5ÀÐBÔCÜ×%Ñ%Õ'r   )ÚreturnN)Ú__name__Ú
__module__Ú__qualname__r   r#   © r   r   r
   r
   0   s   „ ó
/ô(r   r
   c                   ó"   — e Zd Zedefd„«       Zy)ÚRepoFilesCommandÚparserc                 ó@  — | j                  dd¬«      }|j                  dt        d¬«       |j                  dd¬	«      }|j                  d
d¬«      }|j	                  d„ ¬«       |j                  ddt        d¬«       |j                  dg d¢dd¬«       |j                  dt        d¬«       |j                  dt        d¬«       |j                  dt        d¬«       |j                  ddd¬ «       |j                  d!t        d"¬«       |j	                  t
        ¬«       y )#Nz
repo-filesz!Manage files in a repo on the Hub)Úhelpr   z9The ID of the repo to manage (e.g. `username/repo-name`).)Útyper-   z$Action to execute against the files.T)r-   ÚrequiredÚdeletez#Delete files from a repo on the Hubc                 ó   — t        | «      S )N)r
   )r   s    r   ú<lambda>z6RepoFilesCommand.register_subcommand.<locals>.<lambda>[   s   € Ô8MÈdÓ8S€ r   )Úfuncr   ú+z'Glob patterns to match files to delete.)Únargsr.   r-   z--repo-type)ÚmodelÚdatasetÚspacer6   z/Type of the repo to upload to (e.g. `dataset`).)ÚchoicesÚdefaultr-   z
--revisionz°An optional Git revision to push to. It can be a branch name or a PR reference. If revision does not exist and `--create-pr` is not set, a branch will be automatically created.z--commit-messagez9The summary / title / first line of the generated commit.z--commit-descriptionz(The description of the generated commit.z--create-prÚ
store_truez7Whether to create a new Pull Request for these changes.)Úactionr-   z--tokenzIA User Access Token generated from https://huggingface.co/settings/tokens)Ú
add_parserÚadd_argumentÚstrÚadd_subparsersÚset_defaultsr*   )r+   Úrepo_files_parserÚrepo_files_subparsersÚdelete_subparsers       r   Úregister_subcommandz$RepoFilesCommand.register_subcommandM   so  € à"×-Ñ-¨lÐAdÐ-ÓeÐØ×&Ñ&ØœCÐ&að 	'ô 	
ð !2× @Ñ @Ø7Øð !Aó !
Ðð 1×;Ñ;ØØ6ð <ó 
Ðð 	×%Ñ%Ñ+SÐ%ÔTØ×%Ñ%ØØÜØ:ð	 	&ô 	
ð 	×%Ñ%ØÚ1ØØBð	 	&ô 	
ð 	×%Ñ%ØÜð_ð	 	&ô 	
ð 	×%Ñ%Ø¤SÐ/jð 	&ô 	
ð 	×%Ñ%Ø"¬Ð3]ð 	&ô 	
ð 	×%Ñ%Ø ,Ð5nð 	&ô 	
ð 	×&Ñ&ØÜØ\ð 	'ô 	
ð 	×&Ñ&Ô,<Ð&Õ=r   N)r%   r&   r'   Ústaticmethodr   rE   r(   r   r   r*   r*   L   s   „ Øð2>Ð$5ò 2>ó ñ2>r   r*   N)Ú__doc__Úargparser   Útypingr   r   Úhuggingface_hubr   Úhuggingface_hub.commandsr   Úhuggingface_hub.hf_apir   Ú
get_loggerr%   Úloggerr
   r*   r(   r   r   ú<module>rO      sF   ðñõ, 'ß !å #Ý >Ý (ð 
ˆ×	Ñ	˜HÓ	%€÷(ñ (ô84>Ð0õ 4>r   