
    obv                     8   d Z ddlmZmZ ddlZddlZddlmZmZm	Z	m
Z
 ddlmZ ej                  rddlmZmZ ddlmZ  ej$                  d	d
d      Zej(                   G d dee   ej*                  e                Z G d dee   ej*                  e         Zy)z-Manage a directory in a *parent* filesystem.
    )print_functionunicode_literalsN   )abspathjoinnormpathrelpath)WrapFS)TextTuple)FS_Fr   T)bound	covariantc                   :     e Zd ZdZ fdZd Zd Zd Zd Z xZ	S )SubFSzA sub-directory on a parent filesystem.

    A SubFS is a filesystem object that maps to a sub-directory of
    another filesystem. This is the object that is returned by
    `~fs.base.FS.opendir`.

    c                 ^    t         t        |   |       t        t	        |            | _        y N)superr   __init__r   r   _sub_dir)self	parent_fspath	__class__s      */usr/lib/python3/dist-packages/fs/subfs.pyr   zSubFS.__init__    s"    eT#I./    c                 x    dj                  | j                  j                  | j                  | j                        S )Nz{}({!r}, {!r}))formatr   __name___wrap_fsr   r   s    r   __repr__zSubFS.__repr__%   s.    &&NN##T]]DMM
 	
r   c                 P    dj                  | j                  | j                        S )Nz{parent}{dir})parentdir)r   r!   r   r"   s    r   __str__zSubFS.__str__+   s     %%T]]%NNr   c                     | j                   S r   )r!   r"   s    r   delegate_fszSubFS.delegate_fs/   s    }}r   c                 n    t        | j                  t        t        |                  }| j                  |fS r   )r   r   r	   r   r!   )r   r   _paths      r   delegate_pathzSubFS.delegate_path3   s*    T]]GHTN$;<}}e##r   )
r    
__module____qualname____doc__r   r#   r'   r)   r,   __classcell__r   s   @r   r   r      s"    0

O$r   r   c                   "     e Zd ZdZ fdZ xZS )ClosingSubFSz9A version of `SubFS` which closes its parent when closed.c                 f    | j                         j                          t        t        |           y r   )r)   closer   r3   )r   r   s    r   r5   zClosingSubFS.close<   s%      "lD')r   )r    r-   r.   r/   r5   r0   r1   s   @r   r3   r3   9   s    C* *r   r3   )r/   
__future__r   r   typingsixr   r   r   r   r	   wrapfsr
   TYPE_CHECKINGr   r   baser   TypeVarr   python_2_unicode_compatibleGenericr   r3    r   r   <module>r@      s    8  
 2 2 	" V^^D5   $F2Jr* $ !$D*59fnnR0 *r   