wL idZddlmZddlmZmZddlmZddlm Z ddl m Z ddl m Z ejeZGd d ZGd d e Zy )aContains command to update or delete files in a repository using the CLI. Usage: # delete all huggingface-cli repo-files delete "*" # delete single file huggingface-cli repo-files delete file.txt # delete single folder huggingface-cli repo-files delete folder/ # delete multiple huggingface-cli repo-files delete file.txt folder/ file2.txt # delete multiple patterns huggingface-cli repo-files delete file.txt "*.json" "folder/*.parquet" # delete from different revision / repo-type huggingface-cli repo-files delete file.txt --revision=refs/pr/1 --repo-type=dataset )_SubParsersAction)ListOptional)logging)BaseHuggingfaceCLICommand)HfApi)show_deprecation_warningceZdZddZddZy)DeleteFilesSubCommandNcZ||_|j|_|j|_|j|_t |j d|_|j|_|j|_|j|_ |j|_ |j |_y)Nzhuggingface-cli)token library_name) argsrepo_id repo_typerevisionrrapipatternscommit_messagecommit_description create_pr)selfrs i/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/huggingface_hub/commands/repo_files.py__init__zDeleteFilesSubCommand.__init__3sz  LL (,'+}} djj?PQ#'== -1-@-@151H1H#~~$(JJ c Ztddtj|jj |j |j |j|j|j|j|j}td|dtjy)Nzhuggingface-cli repo-filesz hf repo-files)delete_patternsrrrrrrz+Files correctly deleted from repo. Commit: .)r rset_verbosity_infor delete_filesrrrrrrrprintset_verbosity_warning)rurls rrunzDeleteFilesSubCommand.run?s !=O""$hh## MMLLnn]]..#66nn$  ;C5BC%%'r)returnN)__name__ __module__ __qualname__rr%rrr r 2s  /(rr c"eZdZedefdZy)RepoFilesCommandparserc@|jdd}|jdtd|jdd }|jd d }|j d |jddtd|jdgddd|jdtd|jdtd|jdtd|jddd |jd!td"|j t y)#Nz repo-filesz!Manage files in a repo on the Hub)helprz9The ID of the repo to manage (e.g. `username/repo-name`).)typer/z$Action to execute against the files.T)r/requireddeletez#Delete files from a repo on the Hubct|S)N)r )rs rz6RepoFilesCommand.register_subcommand.._s 8Md8Sr)funcr+z'Glob patterns to match files to delete.)nargsr0r/z --repo-type)modeldatasetspacer8z/Type of the repo to upload to (e.g. `dataset`).)choicesdefaultr/z --revisionzAn 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_argumentstradd_subparsers set_defaultsr,)r-repo_files_parserrepo_files_subparsersdelete_subparsers rregister_subcommandz$RepoFilesCommand.register_subcommandQso"--lAd-e&& C&a ' !2 @ @7!A! 1;; 6<  %%+S%T%% : & %% 1B & %% _ &  %% S/j &  %% "3] &  %% ,5n &  && \ ' &&,<&=rN)r'r(r) staticmethodrrGr*rrr,r,Ps2>$52>2>rr,N)__doc__argparsertypingrrhuggingface_hubrhuggingface_hub.commandsrhuggingface_hub.hf_apir _cli_utilsr get_loggerr'loggerr r,r*rrrRsI,'!#>(0   H %((<4>04>r