U
    ^»{jð  ã                   @   s
  d dl Z d dlZd dlmZmZ d dlmZ d dlmZ G dd„ deƒZeeeee	edf f Z
eG dd	„ d	eƒƒZeeef ed
œdd„Ze  ¡ fe
eeef dœdd„Zejeee	e
f dœdd„ƒZeje	dœdd„ƒZejedœdd„ƒZejedœdd„ƒZdS )é    N)ÚDictÚUnion)Úruntime_checkable)ÚProtocolc                   @   s   e Zd ZdZdS )ÚSymlinkz6
    A string indicating the target of a symlink.
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   ú^/var/www/html/bwave/python/venv/lib/python3.8/site-packages/importlib_resources/tests/_path.pyr      s   r   Ú	FilesSpecc                   @   s4   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ ZdS )Ú	TreeMakerc                 O   s   d S ©Nr   )ÚselfÚargsÚkwargsr   r   r   Ú__truediv__   ó    zTreeMaker.__truediv__c                 K   s   d S r   r   )r   r   r   r   r   Úmkdir   r   zTreeMaker.mkdirc                 K   s   d S r   r   )r   Úcontentr   r   r   r   Ú
write_text   r   zTreeMaker.write_textc                 C   s   d S r   r   )r   r   r   r   r   Úwrite_bytes   r   zTreeMaker.write_bytesc                 C   s   d S r   r   )r   Útargetr   r   r   Ú
symlink_to    r   zTreeMaker.symlink_toN)r   r   r	   r   r   r   r   r   r   r   r   r   r      s
   r   )ÚobjÚreturnc                 C   s   t | tƒr| S t | ¡S r   )Ú
isinstancer   ÚpathlibÚPath)r   r   r   r   Ú_ensure_tree_maker#   s    r    )ÚspecÚprefixc                 C   s(   |   ¡ D ]\}}t|t|ƒ| ƒ qdS )aÿ  
    Build a set of files/directories, as described by the spec.

    Each key represents a pathname, and the value represents
    the content. Content may be a nested directory.

    >>> spec = {
    ...     'README.txt': "A README file",
    ...     "foo": {
    ...         "__init__.py": "",
    ...         "bar": {
    ...             "__init__.py": "",
    ...         },
    ...         "baz.py": "# Some code",
    ...         "bar.py": Symlink("baz.py"),
    ...     },
    ...     "bing": Symlink("foo"),
    ... }
    >>> target = getfixture('tmp_path')
    >>> build(spec, target)
    >>> target.joinpath('foo/baz.py').read_text(encoding='utf-8')
    '# Some code'
    >>> target.joinpath('bing/bar.py').read_text(encoding='utf-8')
    '# Some code'
    N)ÚitemsÚcreater    )r!   r"   ÚnameÚcontentsr   r   r   Úbuild'   s    r'   )r   c                 C   s   |j dd� t| |d� d S )NT)Úexist_ok)r"   )r   r'   ©r   Úpathr   r   r   r$   H   s    r$   c                 C   s   |  | ¡ d S r   )r   r)   r   r   r   Ú_N   s    r+   c                 C   s   |j | dd� d S )Nzutf-8)Úencoding)r   r)   r   r   r   r+   S   s    c                 C   s   |  | ¡ d S r   )r   r)   r   r   r   r+   X   s    )r   Ú	functoolsÚtypingr   r   r   r   Ústrr   Úbytesr   r   r    r   r'   Úsingledispatchr$   Úregisterr+   r   r   r   r   Ú<module>   s,   þ
þ!