L i pddlZddlZddlZddlmZddlmZgdZdadZ d dZ d dZ e d k(re yy) N)Path)ZipFile) dbmcursestkinterrtesttests idle_testz__phello__.foo.pyz _bootstrap.pyz_bootstrap_external.pycD|j|r|t|dS|S)N) startswithlen)textprefixs V/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/torch/utils/_zip.py remove_prefixr!s$ vCKM"" Kc|t|tdzz}t|}|jtvry|j ||y)N/)rstrip_file_dirrname DENY_LISTwrite) file_pathstrip_file_pathzf prepend_strstripped_file_pathpaths r write_to_zipr 'sC$}YQT@T'UU " #D yyIHHY*+rctjd}|jddd|jddd |jd d d |jdddd|jddd |j}|jdz|j z}|j a|j}t|d}t|jD]x}tjj|rAtj|dzd}t|D]}t!|tdz||ct!|tdz||zy)Nz Zip py source) descriptionpaths*z Paths to zip.)nargshelpz --install-dirz --install_dirz#Root directory for all output files)r&z --strip-dirz --strip_dirz1The absolute directory we want to remove from zipz --prepend-strz --prepend_strz7A string to prepend onto all paths of a file in the zipr )r&defaultz --zip-namez --zip_namezOutput zip namerw)modez/**/*.pyT) recursive)r)argparseArgumentParser add_argument parse_args install_dirzip_name strip_dirrrrsortedr#osrisdirglobr )parserargs zip_file_namerrpfilesrs rmainr;/s\  $ $ AF sA /T  @   F    l9JK    D$$s*T]]:M^^N""K S )B DJJ  O 77== IIa*n=E#E]  ~3R[  NS0"+ N Or__main__)r )returnN) r+r5r3pathlibrzipfilerrrrr r;__name__rrrBsG    $ ,$ON zFr