+
    Bi>                         R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
Ht ^RIHt  ! R R]P                  4      t ! R R]4      t ! R	 R
]4      t ! R R4      tR# )z
Post-processing hooks
N)ZipFile)TarFile)
get_loggerc                      a  ] tR t^t o RtR	R lt]]P                  R 4       4       t	]P                  R 4       t
]P                  R 4       tR tRtV tR# )
ExtractorProcessora  
Abstract base class for extractions from compressed archives.

Subclasses can be used with :meth:`pooch.Pooch.fetch` and
:func:`pooch.retrieve` to unzip a downloaded data file into a folder in the
local data store. :meth:`~pooch.Pooch.fetch` will return a list with the
names of the extracted files instead of the archive.

Parameters
----------
members : list or None
    If None, will unpack all files in the archive. Otherwise, *members*
    must be a list of file names to unpack from the archive. Only these
    files will be unpacked.
extract_dir : str or None
    If None, files will be unpacked to the default location (a folder in
    the same location as the downloaded zip file, with a suffix added).
    Otherwise, files will be unpacked to ``extract_dir``, which is
    interpreted as a *relative path* (relative to the cache location
    provided by :func:`pooch.retrieve` or :meth:`pooch.Pooch.fetch`).

Nc                    Wn         W n        R # N)membersextract_dir)selfr	   r
   s   &&&N/var/www/html/photoedit/myenv/lib/python3.14/site-packages/pooch/processors.py__init__ExtractorProcessor.__init__1   s    &    c                    R# )zz
String appended to unpacked archive folder name.
Only used if extract_dir is None.
MUST BE IMPLEMENTED BY CHILD CLASSES.
N r   s   &r   suffixExtractorProcessor.suffix5       r   c                    R# )zN
Return all the members in the archive.
MUST BE IMPLEMENTED BY CHILD CLASSES.
Nr   )r   fnames   &&r   _all_membersExtractorProcessor._all_members>   r   r   c                    R# )z}
This method receives an argument for the archive to extract and the
destination path.
MUST BE IMPLEMENTED BY CHILD CLASSES.
Nr   )r   r   r
   s   &&&r   _extract_file ExtractorProcessor._extract_fileE   r   r   c           
     Z  a a S P                   f   VS P                  ,           S n         MaVP                  \        P                  P
                  ^R7      ^ ,          p\        P                  P                  VS P                   4      S n         S P                  e   S P                  '       g   S P                  V4      pMS P                  pVR9   gp   \        P                  P                  S P                   4      '       dA   \        ;QJ d    V 3R lV 4       F  '       d   K   RM	  RM! V 3R lV 4       4      '       g?   \        P                  ! S P                   RR7       S P                  VS P                   4       . p\        P                  ! S P                   4       EF  w  rxp	V	 F  p
\        P                  P                  \        P                  P                  \        P                  P                  VS P                   4      V
4      4      oS P                  eW   \         ;QJ d)    V3R lS P                   4       F  '       g   K   RM	  RM! V3R lS P                   4       4      '       g   K  VP#                  \        P                  P                  Wz4      4       K  	  EK
  	  V# )a  
Extract all files from the given archive.

Parameters
----------
fname : str
    Full path of the zipped file in local storage.
action : str
    Indicates what action was taken by :meth:`pooch.Pooch.fetch` or
    :func:`pooch.retrieve`:

    * ``"download"``: File didn't exist locally and was downloaded
    * ``"update"``: Local file was outdated and was re-download
    * ``"fetch"``: File exists and is updated so it wasn't downloaded

pooch : :class:`pooch.Pooch`
    The instance of :class:`pooch.Pooch` that is calling this.

Returns
-------
fnames : list of str
    A list of the full path to all files in the extracted archive.

)maxsplitc              3      <"   T FL  p\         P                  P                  \         P                  P                  SP                  V4      4      x  KN  	  R # 5ir   )ospathexistsjoinr
   ).0mr   s   & r   	<genexpr>.ExtractorProcessor.__call__.<locals>.<genexpr>u   s9      KRarww||D,<,<a@AA7s   AAFT)exist_okc              3      <"   T F3  pSP                  \        P                  P                  V4      4      x  K5  	  R # 5ir   )
startswithr    r!   normpath)r$   r%   relpaths   & r   r&   r'      s1      /EQG&&rww'7'7':;;\s   ;>updatedownload)r
   r   rsplitr    r!   sepr#   r	   r   r"   allmakedirsr   walkr+   r,   anyappend)r   r   actionpoocharchive_dirr	   fnamesr!   _filesfilenamer,   s   f&&&       @r   __call__ExtractorProcessor.__call__M   s   2 #$t{{2D,,rww{{Q,?BK!ww||K9I9IJD <<t|||''.GllG--GGNN4#3#3443 KR333 KR  
 KK((48ud&6&67  ggd&6&67NDU!''**GGLLt7G7G!H(S <<'33 /EI\\/333 /EI\\/ , , MM"'',,t">? " 8 r   )r
   r	   )NN)__name__
__module____qualname____firstlineno____doc__r   propertyabcabstractmethodr   r   r   r>   __static_attributes____classdictcell____classdict__s   @r   r   r      so     .'    	  	 = =r   r   c                   @   a  ] tR t^t o Rt]R 4       tR tR tRt	V t
R# )Unzipa  
Processor that unpacks a zip archive and returns a list of all files.

Use with :meth:`pooch.Pooch.fetch` or :func:`pooch.retrieve` to unzip a
downloaded data file into a folder in the local data store. The
method/function will return a list with the names of the unzipped files
instead of the zip archive.

The output folder is ``{fname}.unzip``.

Parameters
----------
members : list or None
    If None, will unpack all files in the zip archive. Otherwise, *members*
    must be a list of file names to unpack from the archive. Only these
    files will be unpacked.
extract_dir : str or None
    If None, files will be unpacked to the default location (a folder in
    the same location as the downloaded zip file, with the suffix
    ``.unzip`` added). Otherwise, files will be unpacked to
    ``extract_dir``, which is interpreted as a *relative path* (relative to
    the cache location provided by :func:`pooch.retrieve` or
    :meth:`pooch.Pooch.fetch`).

c                    R# )T
String appended to unpacked archive folder name.
Only used if extract_dir is None.
z.unzipr   r   s   &r   r   Unzip.suffix        r   c                    \        VR4      ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     R# ; iz(Return all members from a given archive.rN)r   namelist)r   r   zip_files   && r   r   Unzip._all_members   s,    UC  H$$& !   s	   0A	c                L   \        VR4      ;_uu_ 4       pV P                  f.   \        4       P                  RW4       VP	                  VR7       MV P                   F  p\        4       P                  RWAV4       VP                  4        Uu. uFX  p\        P                  P                  V4      P                  \        P                  P                  V4      4      '       g   KV  VNKZ  	  ppVP	                  WbR7       K  	  RRR4       R# u upi   + '       g   i     R# ; i)W
This method receives an argument for the archive to extract and the
destination path.
rT   Nz"Unzipping contents of '%s' to '%s')r!   !Extracting '%s' from '%s' to '%s')r	   r!   )
r   r	   r   info
extractallrU   r    r!   r+   r*   )r   r   r
   rV   membernamesubdir_memberss   &&&    r   r   Unzip._extract_file   s    
 UC  H||#!!8% ###5"llFL%%;VK %-$5$5$7&$7D77++D1<<RWW=M=Mf=UV $7 # & '''Q! + ! $&% !  s%   A8DAD
%D
+DDD#	r   Nr@   rA   rB   rC   rD   rE   r   r   r   rH   rI   rJ   s   @r   rM   rM      s/     4  '
R Rr   rM   c                   @   a  ] tR t^t o Rt]R 4       tR tR tRt	V t
R# )Untara  
Processor that unpacks a tar archive and returns a list of all files.

Use with :meth:`pooch.Pooch.fetch` or :func:`pooch.retrieve` to untar a
downloaded data file into a folder in the local data store. The
method/function will return a list with the names of the extracted files
instead of the archive.

The output folder is ``{fname}.untar``.


Parameters
----------
members : list or None
    If None, will unpack all files in the archive. Otherwise, *members*
    must be a list of file names to unpack from the archive. Only these
    files will be unpacked.
extract_dir : str or None
    If None, files will be unpacked to the default location (a folder in
    the same location as the downloaded tar file, with the suffix
    ``.untar`` added). Otherwise, files will be unpacked to
    ``extract_dir``, which is interpreted as a *relative path* (relative to
    the cache location  provided by :func:`pooch.retrieve` or
    :meth:`pooch.Pooch.fetch`).
c                    R# )rO   z.untarr   r   s   &r   r   Untar.suffix   rQ   r   c                    \         P                  ! VR4      ;_uu_ 4       pVP                  4        Uu. uF  q3P                  NK  	  upuuRRR4       # u upi   + '       g   i     R# ; irS   )r   open
getmembersr^   )r   r   tar_filer[   s   &&  r   r   Untar._all_members   sK    \\%%%*2*=*=*?@*?$II*?@ &%@ &%%s   AAAAA*	c                   \         P                  R	8  d   / MRR/p\        P                  ! VR4      ;_uu_ 4       pV P                  f0   \        4       P                  RW4       VP                  ! R
RV/VB  MV P                   F  p\        4       P                  RWQV4       VP                  4        Uu. uFb  p\        P                  P                  VP                  4      P                  \        P                  P                  V4      4      '       g   K`  VNKd  	  ppVP                  ! R
RVRV/VB  K  	  RRR4       R# u upi   + '       g   i     R# ; i)rY   filterdatarT   Nz"Untarring contents of '%s' to '%s'r!   rZ   r	   )      r   )sysversion_infor   rg   r	   r   r[   r\   rh   r    r!   r+   r^   r*   )r   r   r
   filter_kwargri   r]   r[   r_   s   &&&     r   r   Untar._extract_file   s-   
 !--7rh=O\\%%%||#!!8% ##EEE"llFL%%;VK %-$7$7$9&$9D77++DII6AAGG,,V4 $9 # & ''  .5@DP) + &%(&) &%%s%   A:E5AE
E
EEE	r   Nra   rJ   s   @r   rc   rc      s.     4  A
$ $r   rc   c            
       b   a  ] tR tRt o RtRRR]R]R]R]/tR	RR
RRR/t	RR lt
R tR tRtV tR# )
Decompressi$  a  
Processor that decompress a file and returns the decompressed version.

Use with :meth:`pooch.Pooch.fetch` or :func:`pooch.retrieve` to decompress
a downloaded data file so that it can be easily opened. Useful for data
files that take a long time to decompress (exchanging disk space for
speed).

Supported decompression methods are LZMA (``.xz``), bzip2 (``.bz2``), and
gzip (``.gz``).

File names with the standard extensions (see above) can use
``method="auto"`` to automatically determine the compression method. This
can be overwritten by setting the *method* argument.

.. note::

    To unpack zip and tar archives with one or more files, use
    :class:`pooch.Unzip` and :class:`pooch.Untar` instead.

The output file is ``{fname}.decomp`` by default but it can be changed by
setting the ``name`` parameter.

.. warning::

    Passing in ``name`` can cause existing data to be lost! For example, if
    a file already exists with the specified name it will be overwritten
    with the new decompressed file content. **Use this option with
    caution.**

Parameters
----------
method : str
    Name of the compression method. Can be "auto", "lzma", "xz", "bzip2",
    or "gzip".
name : None or str
    Defines the decompressed file name. The file name will be
    ``{fname}.decomp`` if ``None`` (default) or the given name otherwise.
    Note that the name should **not** include the full (or relative) path,
    it should be just the file name itself.

autoNlzmaxzgzipbzip2z.xzz.gzz.bz2c                    Wn         W n        R # r   methodr^   )r   r}   r^   s   &&&r   r   Decompress.__init__S  s    	r   c           	        V P                   f   VR,           pMG\        P                  P                  \        P                  P	                  V4      V P                   4      pVR9   g&   \        P                  P                  V4      '       g   \        4       P                  RVVV P                  4       V P                  V4      p\        VR4      ;_uu_ 4       pVP                  V4      ;_uu_ 4       p\        P                  ! Wv4       RRR4       RRR4       V# V#   + '       g   i     L; i  + '       g   i     T# ; i)a  
Decompress the given file.

The output file will be either ``{fname}.decomp`` or the given *name*
class attribute.

Parameters
----------
fname : str
    Full path of the compressed file in local storage.
action : str
    Indicates what action was taken by :meth:`pooch.Pooch.fetch` or
    :func:`pooch.retrieve`:

    - ``"download"``: File didn't exist locally and was downloaded
    - ``"update"``: Local file was outdated and was re-download
    - ``"fetch"``: File exists and is updated so it wasn't downloaded

pooch : :class:`pooch.Pooch`
    The instance of :class:`pooch.Pooch` that is calling this.

Returns
-------
fname : str
    The full path to the decompressed file.
Nz.decompz-Decompressing '%s' to '%s' using method '%s'.zw+br-   )r^   r    r!   r#   dirnamer"   r   r[   r}   _compression_modulerg   shutilcopyfileobj)r   r   r7   r8   decompressedmoduleoutput
compresseds   &&&&    r   r>   Decompress.__call__W  s    6 99 9,L77<<(>		JL++277>>,3O3OL?	 --e4FlE**f[['':&&z: ( + | (' +* s$   D/1D	D/D,'D//E 	c                   RpV P                   V P                  9  dc   RV P                    R\        V P                  P                  4       4       R2pV P                   R9   d   RP	                  W2.4      p\        V4      hV P                   R8X  d   \        P                  P                  V4      R	,          pW@P                  9  dO   RV R\        V P                  P                  4       4       R2pVR
9   d   RP	                  W2.4      p\        V4      hV P                  V P                  V,          ,          # V P                  V P                   ,          # )z
Get the Python module compatible with fname and the chosen method.

If the *method* attribute is "auto", will select a method based on the
extension. If no recognized extension is in the file name, will raise a
ValueError.
z:To unpack zip/tar archives, use pooch.Unzip/Untar instead.zInvalid compression method 'z'. Must be one of 'z'. rv   zUnrecognized file extension '>   tarzip>   .tar.zip)
r}   moduleslistkeysr#   
ValueErrorr    r!   splitext
extensions)r   r   error_archivesmessageexts   &&   r   r   Decompress._compression_module  s+    V;;dll*.t{{m <##'(9(9(;#<"=RA  {{n,((G#<=W%%;;& ''""5)"-C//)3C5 9''+DOO,@,@,B'C&DBH  **!hh'@AG ))<< 455||DKK((r   r|   )rv   N)r@   rA   rB   rC   rD   rw   ry   bz2r   r   r   r>   r   rH   rI   rJ   s   @r   ru   ru   $  sN     )V tVT4vtWcRG@J*X) )r   ru   )rD   rF   r    r   ry   rw   r   rp   zipfiler   tarfiler   utilsr   ABCr   rM   rc   ru   r   r   r   <module>r      sk     	 
    
   q qhER ERPL L^{) {)r   