
     i                        d dl mZ d dlZd dlmZmZ ddlmZmZ ddl	m
Z
mZmZmZmZmZ ddlmZ ddlmZ ej        rd d	lmZmZmZmZmZmZ dd
lmZ ddlmZ  G d de          ZdS )    )annotationsN)ABCabstractmethod   )copy_dir	copy_file)DestinationExistsDirectoryExpectedFileExpectedFilesystemClosed	NoSysPathResourceNotFound)dirnameBoundWalker)IOAny
CollectionIteratorSelfType)InfoSubFSc                     e Zd ZU dZdZded<   ed;d<d            Zed=d            Zed=d            Z	ed=d            Z
ed>d            Zed?d@d            Zed?d@d            ZedAdBd            ZedCd            ZedCd            ZedCd            Zed?dDd!            ZdEd"Zd# ZdFd$ZdGd&Zd' Zd( Zdd)dHd,Z	 dAdId.ZedJd0            ZdKd2ZdLd4Zd?dMd6Zd?dNd9Z d?dNd:Z!dS )OFSz+Abstract base class for custom filesystems.Fbool_closedrbpathstrmodereturnIO[Any]c                    d S N )selfr    r"   kwargss       i/srv/www/vhosts/g4struct/public_html/venv/lib/python3.11/site-packages/fontTools/misc/filesystem/_base.pyopenzFS.open   s    FIc    c                    d S r&   r'   r(   r    s     r*   existsz	FS.exists!       ),r,   c                    d S r&   r'   r.   s     r*   isdirzFS.isdir$   s    (+r,   c                    d S r&   r'   r.   s     r*   isfilez	FS.isfile'   r0   r,   	list[str]c                    d S r&   r'   r.   s     r*   listdirz
FS.listdir*   s    /2sr,   recreater   c                    d S r&   r'   r(   r    r8   s      r*   makedirz
FS.makedir-   s    CF3r,   c                    d S r&   r'   r:   s      r*   makedirszFS.makedirs0   s    DGCr,   N
namespacesCollection[str] | Noner   c                    d S r&   r'   r(   r    r>   s      r*   getinfoz
FS.getinfo3   s    UXUXr,   Nonec                    d S r&   r'   r.   s     r*   removez	FS.remove6   r0   r,   c                    d S r&   r'   r.   s     r*   	removedirzFS.removedir9   s    ,/Cr,   c                    d S r&   r'   r.   s     r*   
removetreezFS.removetree<   s    -0Sr,   srcdstcreatec                    d S r&   r'   )r(   rJ   rK   rL   s       r*   movedirz
FS.movedir?   s    ILr,   c                (    t          d| d          )Nthe filesystem z has no system path)r   r.   s     r*   
getsyspathzFS.getsyspathB   s    E$EEEFFFr,   c                    d| _         d S )NTr   r(   s    r*   closezFS.closeE   s    r,   c                    | j         S r&   rS   rT   s    r*   isclosedzFS.isclosedH   s
    |r,   r   c                    | S r&   r'   rT   s    r*   	__enter__zFS.__enter__K   s    r,   c                .    |                                   dS )NF)rU   )r(   exc_typeexctbs       r*   __exit__zFS.__exit__N   s    

ur,   c                :    | j         rt          d| d          d S )NrP   z
 is closed)r   r   rT   s    r*   checkzFS.checkR   s3    < 	I"#GT#G#G#GHHH	I 	Ir,   )factoryra   Type[SubFS] | Nonec               .    |ddl m} |} || |          S )u+   Return a sub‑filesystem rooted at `path`.Nr   r   )_subfsr   )r(   r    ra   r   s       r*   opendirz
FS.opendirV   s0    ?%%%%%%GwtT"""r,   Iterator[Info]c                N      fd                                D             S )Nc              3  N   K   | ]}                      d |           V   dS )/N)rB   ).0pr>   r    r(   s     r*   	<genexpr>zFS.scandir.<locals>.<genexpr>a   s;      TTA]]q]]J77TTTTTTr,   )r7   rA   s   ```r*   scandirz
FS.scandir^   s4     UTTTTTdASASTTTTr,   r   c                     t          |           S r&   r   rT   s    r*   walkzFS.walkc   s    4   r,   bytesc                    |                      |d          5 }|                                cd d d            S # 1 swxY w Y   d S )Nr   )r+   read)r(   r    fs      r*   	readbyteszFS.readbytesg   s    YYtT"" 	a6688	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   8<<datac                    |                      |d          5 }|                    |           d d d            d S # 1 swxY w Y   d S )Nwb)r+   write)r(   r    ru   rs   s       r*   
writebyteszFS.writebytesk   s    YYtT"" 	aGGDMMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   :>>wipec                    |s|                      |          rdS |                     |d          5  	 d d d            n# 1 swxY w Y   dS )NFrw   T)r/   r+   )r(   r    rz   s      r*   rL   z	FS.createo   s     	D)) 	5YYtT"" 	 		 	 	 	 	 	 	 	 	 	 	 	 	 	 	ts   >AAsrc_pathdst_pathc                   |                      |          st          |d          |                     |          st          d|d          |s(|                      |          rt	          d|d          |                     t          |                    s t          dt          |          d          t          | || |           d S )N does not existpath z should be a filezdestination z already exists should be a directory)	r/   r   r4   r   r	   r2   r   r
   r   )r(   r|   r}   	overwrites       r*   copyzFS.copyv   s    {{8$$ 	F"h#A#A#ABBBX&& 	FDxDDDEEE 	PT[[22 	P#$N8$N$N$NOOOzz'(++,, 	Y#$WGH,=,=$W$W$WXXX$$11111r,   c                    |s'|                      |          st          |d          |                     |          st          d|d          t	          | || |           d S )Nr   r   r   )r/   r   r2   r
   r   )r(   r|   r}   rL   s       r*   copydirz
FS.copydir   s     	Cdkk(33 	C"h#A#A#ABBBzz(## 	P#$NH$N$N$NOOOxx00000r,   )r   )r    r!   r"   r!   r#   r$   )r    r!   r#   r   )r    r!   r#   r5   )F)r    r!   r8   r   r#   r   r&   )r    r!   r>   r?   r#   r   )r    r!   r#   rC   )rJ   r!   rK   r!   rL   r   r#   rC   )r    r!   r#   r!   )r#   r   )r#   r   )r    r!   ra   rb   r#   r   )r    r!   r>   r?   r#   rf   )r#   r   )r    r!   r#   rp   )r    r!   ru   rp   )r    r!   rz   r   )r|   r!   r}   r!   )"__name__
__module____qualname____doc__r   __annotations__r   r+   r/   r2   r4   r7   r;   r=   rB   rE   rG   rI   rN   rQ   rU   rW   rY   r^   r`   re   rm   propertyro   rt   ry   rL   r   r   r'   r,   r*   r   r      s        55GIIII ^I,,, ^,+++ ^+,,, ^,222 ^2FFFF ^FGGGG ^GXXXX ^X,,, ^,/// ^/000 ^0LLLL ^LG G G G          I I I CG # # # # # # ?CU U U U U
 ! ! ! X!          	2 	2 	2 	2 	21 1 1 1 1 1 1r,   r   ) 
__future__r   typingabcr   r   _copyr   r   _errorsr	   r
   r   r   r   r   _pathr   _walkr   TYPE_CHECKINGr   r   r   r   r   r   _infor   rd   r   r   r'   r,   r*   <module>r      sc   " " " " " "  # # # # # # # # & & & & & & & &                           	 @@@@@@@@@@@@@@@@m1 m1 m1 m1 m1 m1 m1 m1 m1 m1r,   