§
    «˜º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 ddlmZ  ej        e¦  «        Z G d	„ d
¦  «        Z G d„ de	¦  «        ZdS )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)ÚHfApié   )Úshow_deprecation_warningc                   ó   — e Zd Zdd„Zdd„ZdS )ÚDeleteFilesSubCommandÚreturnNc                 ó
  — || _         |j        | _        |j        | _        |j        | _        t	          |j        d¬¦  «        | _        |j        | _        |j        | _        |j	        | _	        |j
        | _
        |j        | _        d S )Nzhuggingface-cli)ÚtokenÚlibrary_name)ÚargsÚrepo_idÚ	repo_typeÚrevisionr   r   ÚapiÚpatternsÚcommit_messageÚcommit_descriptionÚ	create_pr)Úselfr   s     úk/var/www/html/services/rag-service/venv/lib/python3.11/site-packages/huggingface_hub/commands/repo_files.pyÚ__init__zDeleteFilesSubCommand.__init__3   sp   € ØˆŒ	Ø œLˆŒØ(,¬ˆŒØ'+¤}ˆŒÝ d¤jÐ?PÐQÑQÔQˆŒØ#'¤=ˆŒØ-1Ô-@ˆÔØ15Ô1HˆÔØ#œ~ˆŒØ$(¤JˆŒ
ˆ
ˆ
ó    c           	      ó   — t          dd¦  «         t          j        ¦   «          | j                             | j        | j        | j        | j        | j	        | j
        | j        ¬¦  «        }t          d|› d�¦  «         t          j        ¦   «          d S )Nzhuggingface-cli repo-fileszhf repo-files)Údelete_patternsr   r   r   r   r   r   z+Files correctly deleted from repo. Commit: ú.)r
   r   Úset_verbosity_infor   Údelete_filesr   r   r   r   r   r   r   ÚprintÚset_verbosity_warning)r   Úurls     r   ÚrunzDeleteFilesSubCommand.run?   s”   € Ý Ð!=¸ÑOÔOÐOåÔ"Ñ$Ô$Ð$ØŒh×#Ò#Ø œMØ”LØ”nØ”]ØÔ.Ø#Ô6Ø”nð $ñ 
ô 
ˆõ 	ÐB¸CÐBÐBÐBÑCÔCÐCÝÔ%Ñ'Ô'Ð'Ð'Ð'r   )r   N)Ú__name__Ú
__module__Ú__qualname__r   r&   © r   r   r   r   2   s<   € € € € € ð
/ð 
/ð 
/ð 
/ð(ð (ð (ð (ð (ð (r   r   c                   ó*   — e Zd Zedefd„¦   «         ZdS )ÚRepoFilesCommandÚparserc                 ó¸  — |                       dd¬¦  «        }|                     dt          d¬¦  «         |                     dd¬	¦  «        }|                      d
d¬¦  «        }|                     d„ ¬¦  «         |                     ddt          d¬¦  «         |                     dg d¢dd¬¦  «         |                     dt          d¬¦  «         |                     dt          d¬¦  «         |                     dt          d¬¦  «         |                     ddd¬ ¦  «         |                     d!t          d"¬¦  «         |                     t
          ¬¦  «         d S )#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Ô8S€ r   )Úfuncr   ú+z'Glob patterns to match files to delete.)Únargsr0   r/   z--repo-type)ÚmodelÚdatasetÚspacer8   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_subcommandQ   sç  € à"×-Ò-¨lÐAdÐ-ÑeÔeÐØ×&Ò&Ø�CÐ&að 	'ñ 	
ô 	
ð 	
ð !2× @Ò @Ø7Øð !Añ !
ô !
Ðð 1×;Ò;ØØ6ð <ñ 
ô 
Ðð 	×%Ò%Ð+SÐ+SÐ%ÑTÔTÐTØ×%Ò%ØØÝØ:ð	 	&ñ 	
ô 	
ð 	
ð 	×%Ò%ØØ1Ð1Ð1ØØBð	 	&ñ 	
ô 	
ð 	
ð 	×%Ò%ØÝð_ð	 	&ñ 	
ô 	
ð 	
ð 	×%Ò%Ø¥SÐ/jð 	&ñ 	
ô 	
ð 	
ð 	×%Ò%Ø"­Ð3]ð 	&ñ 	
ô 	
ð 	
ð 	×%Ò%Ø ,Ð5nð 	&ñ 	
ô 	
ð 	
ð 	×&Ò&ØÝØ\ð 	'ñ 	
ô 	
ð 	
ð 	×&Ò&Õ,<Ð&Ñ=Ô=Ð=Ð=Ð=r   N)r'   r(   r)   Ústaticmethodr   rG   r*   r   r   r,   r,   P   s:   € € € € € Øð2>Ð$5ð 2>ð 2>ð 2>ñ „\ð2>ð 2>ð 2>r   r,   N)Ú__doc__Úargparser   Útypingr   r   Úhuggingface_hubr   Úhuggingface_hub.commandsr   Úhuggingface_hub.hf_apir   Ú
_cli_utilsr
   Ú
get_loggerr'   Úloggerr   r,   r*   r   r   ú<module>rR      sô   ððð ð, 'Ð &Ð &Ð &Ð &Ð &Ø !Ð !Ð !Ð !Ð !Ð !Ð !Ð !à #Ð #Ð #Ð #Ð #Ð #Ø >Ð >Ð >Ð >Ð >Ð >Ø (Ð (Ð (Ð (Ð (Ð (à 0Ð 0Ð 0Ð 0Ð 0Ð 0ð 
ˆÔ	˜HÑ	%Ô	%€ð(ð (ð (ð (ð (ñ (ô (ð (ð<4>ð 4>ð 4>ð 4>ð 4>Ð0ñ 4>ô 4>ð 4>ð 4>ð 4>r   