403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.117.216.191
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/cloudlinux/venv/lib/python3.11/site-packages/pyfakefs/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/pyfakefs/__pycache__/fake_pathlib.cpython-311.pyc
�

��bgA����dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddlm
Z
ddlmZddlmZddlmZddlmZdd	lmZdd
lmZmZddlmZd�Zd
�Zd�Z d�Z!	ej"Z#n
#e$$re%Z#YnwxYwGd�de#��Z&e&��Z'e
j(dkr1ej)Z*Gd�de*��Z+Gd�de+��Z,Gd�de+��Z-Gd�dej.��Z/Gd�d��Z0Gd�d��Z1Gd�d ej.��Z2e
j(d!krOd"e
d#e
fd$�Z3ej4e2ej5��D]0\Z6Z7e6�8d%��se9e2e6e3e7�����1Gd&�d'��Z:Gd(�d)��Z;dS)*a�A fake implementation for pathlib working with FakeFilesystem.
New in pyfakefs 3.0.

Usage:

* With fake_filesystem_unittest:
  If using fake_filesystem_unittest.TestCase, pathlib gets replaced
  by fake_pathlib together with other file system related modules.

* Stand-alone with FakeFilesystem:
  `filesystem = fake_filesystem.FakeFilesystem()`
  `fake_pathlib_module = fake_filesystem.FakePathlibModule(filesystem)`
  `path = fake_pathlib_module.Path('/foo/bar')`

Note: as the implementation is based on FakeFilesystem, all faked classes
(including PurePosixPath, PosixPath, PureWindowsPath and WindowsPath)
get the properties of the underlying fake filesystem.
�N)�PurePath)�Callable)�quote_from_bytes)�fake_scandir)�use_scandir)�FakeFilesystem)�FakeFileOpen)�FakeOsModule�use_original_os)�IS_PYPYc�*�|t_tjdkr>t	|��t
j_t|��t
j	_dSt|��}|j}|t
j_|t
j	_dS)z6Initializes the fake module with the fake file system.���N)�FakePath�
filesystem�sys�version_info�_FakeWindowsFlavour�FakePathlibModule�PureWindowsPath�_flavour�_FakePosixFlavour�
PurePosixPathr
�path)r�fake_os�	fake_paths   �f/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pyfakefs/fake_pathlib.py�init_moduler5s|��%�H��
��'�!�!�5H��5T�5T��)�2�3D�Z�3P�3P��'�0�0�0��z�*�*���L�	�5>��)�2�3<��'�0�0�0�c�`��tj����fd���}t|��S)Nc�B���|jt|��g|�Ri|��S�N�r�str)�pathobj�args�kwargs�strfuncs   �r�_wrappedz_wrap_strfunc.<locals>._wrappedFs.����w�w�)�3�w�<�<�I�$�I�I�I�&�I�I�Ir ��	functools�wraps�staticmethod�r)r*s` r�
_wrap_strfuncr0EsF����_�W���J�J�J�J���J���!�!�!r c�`��tj����fd���}t|��S)Nc�X���|jt|��t|��g|�R�Sr#r$��pathobj1�pathobj2r'r)s   �rr*z&_wrap_binary_strfunc.<locals>._wrappedN�.����w�x�*�C��M�M�3�x�=�=�P�4�P�P�P�Pr r+r/s` r�_wrap_binary_strfuncr7M�F����_�W���Q�Q�Q�Q���Q���!�!�!r c�`��tj����fd���}t|��S)Nc�X���|jt|��t|��g|�R�Sr#r$r3s   �rr*z._wrap_binary_strfunc_reverse.<locals>._wrappedVr6r r+r/s` r�_wrap_binary_strfunc_reverser;Ur8r c��eZdZdZeej��Zed���Zeej��Ze	ree
j��Zee
d��r
ed���Znd�Zd�Zeej��Zeej��Zeej��Zeej��Zed���Zed���Zd	ejkred
���Zejdkred���Zd
�Zeej��Zeej ��Z dS)�
_FakeAccessorzQAccessor which forwards some of the functions to FakeFilesystem
    methods.
    c�0�tj||d���S�NF)�follow_symlinks)r�stat)�fsrs  r�<lambda>z_FakeAccessor.<lambda>ks���,�R��u�M�M�M�r �lchmodc�2�tj|||d���Sr?)r�chmod)rBr�modes   rrCz_FakeAccessor.<lambda>us!��>�#7��D�$��$�$�$�r c� �td���)z+Raises not implemented for Windows systems.z%lchmod() not available on this system��NotImplementedError��selfr&r'r(s    rrDz_FakeAccessor.lchmod{s��%�&M�N�N�Nr c��d|vrUtjdkrtd���|ds.tjtjvstrtd���|jjt|��g|�Ri|��S)Nr@�r�
z<chmod() got an unexpected keyword argument 'follow_symlinks'z=`follow_symlinks` for chmod() is not available on this system)
rr�	TypeError�osrF�supports_follow_symlinksrrJrr%rKs    rrFz_FakeAccessor.chmods�����&�&���'�)�)��U�����+�,�
���� ;�;�;�w�;�)�V����(�w�!�'��G���F�t�F�F�F�v�F�F�Fr c�2�tj|||d���S)NT)�
force_replace)r�rename)rB�old_path�new_paths   rrCz_FakeAccessor.<lambda>�s!��~�'<���(�$�(
�(
�(
�r c�2�tj|||d���S)NF)�create_missing_dirs)r�create_symlink)rB�fpath�target�
target_is_dirs    rrCz_FakeAccessor.<lambda>�s!���1N���v�5�2
�2
�2
�r )r�c�.�tj|||��Sr#�r�link�rB�	file_path�link_targets   rrCz_FakeAccessor.<lambda>����~�/B��I�{�0�0�r rNc�.�tj|||��Sr#r`rbs   rrCz_FakeAccessor.<lambda>�rer c�(�tj��Sr#)rQ�getcwd�rLs rrhz_FakeAccessor.getcwd�s���9�;�;�r N)!�__name__�
__module__�__qualname__�__doc__r0rrA�lstat�listdirrr�scandir�hasattrrQrDrF�makedir�mkdir�remove�unlink�rmdirr7rU�replacer;�symlinkrr�link_torarh�readlink�utime�r rr=r=cs����������=��,�-�-�D��M�M�M�
�
�E��m�N�2�3�3�G��6��-�� 4�5�5���w�r�8���
O���
�
�
�
���	O�	O�	O�
G�
G�
G�
�M�.�0�1�1�E�
�]�>�0�
1�
1�F��M�.�.�/�/�E�
!�
!�.�"7�
8�
8�F�"�"�	
�	
���G�+�*�	
�	
���G���!�!�!�&�&�
�
�
�
����7�"�"�#�#�
�
�
�
��	�	�	��}�^�4�5�5�H��M�.�.�/�/�E�E�Er r=rc�F��eZdZdZdZdZdZdZdZd�e	e
d��e
d��d	z��D��d
�e	e
d��e
d��d	z��D��zZ�fd
�Ze
efd���Zd�Ze
d���Zdd�Zd�Zd�Zd�Zd�Zd�Zd�Z�xZS)�_FakeFlavourz9Fake Flavour implementation used by PurePath and _FlavourN�/Fz\\?\c�,�h|]}t|����Sr|��chr��.0�xs  r�	<setcomp>z_FakeFlavour.<setcomp>�s��G�G�G�A��Q���G�G�Gr �a�z�c�,�h|]}t|����Sr|r�r�s  rr�z_FakeFlavour.<setcomp>�s1��K
�K
�K
��C��F�F�K
�K
�K
r �A�Zc���||_|j|_|j|_|j|_tt|���	��dSr#)
r�path_separator�sep�alternative_path_separator�altsep�
is_windows_fs�has_drv�superr~�__init__)rLr�	__class__s  �rr�z_FakeFlavour.__init__�sJ���(�D�O�!�0�D�H�$�?�D�K�%�3�D�L��,��%�%�.�.�0�0�0�0�0r c��d}|�|��rC|dd�}|dd�}|�d��r||dd�z
}d|dd�z}||fS)N��zUNC\r�\)�
startswith)r�
ext_prefix�prefixs   r�_split_extended_pathz!_FakeFlavour._split_extended_path�sv���F����z�*�*�
+��b�q�b����A�B�B�x���?�?�7�+�+�+��d�2�A�2�h�&�F��$�q�r�r�(�?�D��4�<�r c��|dd�}|dd�}||kr3||kr-|�|��\}}|dd�}|dd�}nd}|dd�}||kr�||kr�||kr�|�|d��}|dkrl|�||dz��}||dzkrJ|dkrt|��}|r||d|�z|||dzd�fS|d|�|||dzd�fSdx}	}
|dkr||jvr|dd�}	|dd�}|}||kr|}
|�|��}||	z|
|fS)Nrr��r�r����:)r��find�len�
drive_letters�lstrip)rLrr��first�secondr��third�index�index2�drv�roots           r�_splitroot_with_drivez"_FakeFlavour._splitroot_with_drive�s�����1��I�E��!�A�#�Y�F���}�}��#��� $�8�8��>�>�����Q�q�S�	���a��c��������1��I�E���}�}��#���%�3�,�,�
�	�	�#�q�)�)���B�;�;�!�Y�Y�s�E�A�I�6�6�F�����*�*�!�R�<�<�%(��Y�Y�F�!�T�#)�D��6��N�#:�C��f�q�j�l�l�AS�#S�S�#�G�V�G�}�c�4���
���3E�E�E��O�C�$���}�}��$�*<�!<�!<��2�A�2�h���A�B�B�x������|�|����{�{�3�'�'���C�<��t�+�+r c��|rQ|d|krE|�|��}t|��t|��z
dkrd|dz|fSd||fSdd|fS)Nrr�r�)r�r�)rr��
stripped_parts   r�_splitroot_posixz_FakeFlavour._splitroot_posixso���
$��Q��3��� $���C� 0� 0�
��t�9�9�s�=�1�1�1�Q�6�6��s�Q�w�
�5�5��3�
�-�-��2�t�|�#r c��|�|jj}|jjr|�||��S|�||��S)z%Split path into drive, root and rest.)rr�r�r�r�)rLrr�s   r�	splitrootz_FakeFlavour.splitrootsJ���{��o�4����,�
=��1�1�$��<�<�<��(�(��s�3�3�3r c�F�|jjr|���S|S)z<Return the lower-case version of s for a Windows filesystem.)rr��lower)rLrs  r�casefoldz_FakeFlavour.casefolds"����,�
$��z�z�|�|�#��Kr c�6�|jjrd�|D��S|S)z@Return the lower-case version of parts for a Windows filesystem.c�6�g|]}|�����Sr|)r�)r��ps  r�
<listcomp>z/_FakeFlavour.casefold_parts.<locals>.<listcomp>s ��1�1�1�a����	�	�1�1�1r )rr��rL�partss  r�casefold_partsz_FakeFlavour.casefold_partss(����,�
2�1�1�5�1�1�1�1��Lr c��������j�i������fd��|���rdn�jj}�|t	|����p�S)Nc����|��
��rd}|��
��D]�}|r|dkr�|dkr|��
��\}}}�+|�
z|z}|�vr�|}|��Btd|z���	�	j�|��}d�|<�||��}|�|<��#t$r$}|jtjkr�r�|}Yd}~��d}~wwxYw|S)Nr��.z..zSymlink loop from %r)	r��split�
rpartition�RuntimeErrorrrz�OSError�errno�EINVAL)r�rest�name�_�newpathr\�e�_resolve�seenrLr��stricts       �����rr�z-_FakeFlavour._resolve_posix.<locals>._resolve&s;����?�?�3�'�'���D� �J�J�s�O�O�-�-�D��!�4�3�;�;� ��t�|�|�%)�_�_�S�%9�%9�
��a�� �"�S�j�4�/�G��$���#�G�}���+�$�+�+A�G�+K�L�L�L�-�!%��!9�!9�'�!B�!B��)-��W�
�'�x��f�5�5��(,��W�
�
��#�'�'�'��7�e�l�2�2�v�2�!� '�����������'�����s�B4�4
C"�>C�C"r�)r��is_absoluter�cwdr%)rLrr��baser�r�r�s` ` @@@r�_resolve_posixz_FakeFlavour._resolve_posix"s��������(�C��D�$
�$
�$
�$
�$
�$
�$
�$
�$
�P�)�)�+�+�D�2�2���1D�D��8�D�#�d�)�)�,�,�3��3r c��t|��}|stj��Sd}|rY|j�|��s%|j�tj|��|j�|��S		|j�|��}|�|S|j�	|tj
�|����S#t$r%|}|j�
|��d}YnwxYw��)NTr)r%rQrhr�exists�raise_os_errorr��ENOENT�resolve_path�	joinpathsr�basenamer��	splitpath)rLrr��
previous_ss    r�_resolve_windowsz_FakeFlavour._resolve_windowsQs���t�9�9�D��
#��y�{�{�"��J��
���-�-�d�3�3�G��O�2�2�5�<��F�F�F���3�3�D�9�9�9��
�#��;�;�D�A�A��
&�-�#'�K�#��8�8� �"�'�"2�"2�:�">�">� � ���
#�B�B�B�%)�
�#��8�8��>�>�q�A����B����s�C�,D	�D	c�r�|jjr|�||��S|�||��S)z/Make the path absolute, resolving any symlinks.)rr�r�r�)rLrr�s   r�resolvez_FakeFlavour.resolvehs;����,�
;��,�,�T�6�:�:�:��&�&�t�V�4�4�4r c�(�|sR	tjdS#t$r2ddl}|�tj����jcYSwxYwddl}	|�|��jS#t$rtd|z���wxYw)�.Return the home directory of the current user.�HOMErN�%Can't determine home directory for %r�	rQ�environ�KeyError�pwd�getpwuid�getuid�pw_dir�getpwnamr��rL�usernamer�s   r�
gethomedirz_FakeFlavour.gethomedirn����
�<��:�f�-�-���<�<�<��J�J�J��<�<��	���4�4�;�;�;�;�<����
�
�
�
���<�<��1�1�8�8������&�B�X�M����������9A�A�A4�4Br#)rjrkrlrmrr�r�r��ext_namespace_prefix�range�ordr�r�r.r�r�r�r�r�r�r�r�r�r��
__classcell__)r�s@rr~r~�s��������G�G��
�������(��G�G���s�s�3�x�x���S���A��)F�)F�G�G�G�K
�K
�!�E�#�#�c�(�(�C�C��H�H�q�L�9�9�K
�K
�K
�
�
�	1�	1�	1�	1�	1�
�2F�	 �	 �	 �
��	 �$	,�$	,�$	,�L
�	$�	$�
��	$�	4�	4�	4�	4�	�	�	�	�	�	�-	4�-	4�-	4�^	�	�	�.	5�	5�	5�	�	�	�	�	�	�	r r~c��eZdZdZhd�d�edd��D��zd�edd��D��zZeZd�Zd�Z	d	�Z
d
�ZdS)rz�Flavour used by PureWindowsPath with some Windows specific
        implementations independent of FakeFilesystem properties.
        >�AUX�CON�NUL�PRNc��h|]}d|z��S)zCOM%dr|�r��is  rr�z_FakeWindowsFlavour.<setcomp>����1�1�1�q�w��{�1�1�1r r�rOc��h|]}d|z��S)zLPT%dr|r�s  rr�z_FakeWindowsFlavour.<setcomp>�r�r c���|sdS|jjr|d�d��rdS|d�d��d���|jvS)z=Return True if the path is considered reserved under Windows.Fr�\\r�r�)rr�r��	partition�upper�reserved_namesr�s  r�is_reservedz_FakeWindowsFlavour.is_reserved�sm���
��u���,�
��q��1D�1D�V�1L�1L�
��u���9�&�&�s�+�+�A�.�4�4�6�6�$�:M�M�Mr c�j�|j}t|��dkrc|ddkrW|���dd��d��}d|�dt	|�d������Sdt	|����d����zS)	z$Return a file URI for the given pathr�r�r�Nrzfile:///zutf-8zfile:)�driver��as_posixr��urlquote_from_bytes�encode)rLrrr�s    r�make_uriz_FakeWindowsFlavour.make_uri�s���
�J�E��5�z�z�Q���5��8�s�?�?��}�}���q�r�r�*�1�1�#�6�6����E�E�'����G�(<�(<�=�=�=����!4�T�]�]�_�_�5K�5K�G�5T�5T�!U�!U�U�Ur c��dtjvrtjd}nzdtjvrtjd}nYdtjvr<	tjd}n#t$rd}YnwxYw|tjdz}ntd���|r�tjd|kr�|�|f��\}}}|dtjdkrtd	|z���||d<|s|r$||z|�|d
d���z}n|�|��}|S)r�r��USERPROFILE�HOMEPATH�	HOMEDRIVEr�zCan't determine home directory�USERNAMEr�r�r�N)rQr�r�r��parse_parts�join)rLr��userhomer�r�r�s      rr�z_FakeWindowsFlavour.gethomedir�s\�����#�#��:�f�-����"�*�,�,��:�m�4����r�z�)�)���*�[�1�C�C�������C�C�C��������J�!7�7���"�#C�D�D�D��
4�
�:�j�)�X�5�5�'+�'7�'7���'D�'D�$�C��u��R�y�B�J�z�$:�:�:�*�F��Q����!)�E�"�I��4�d�4�#&��:��	�	�%����)�0D�0D�#D���#'�9�9�U�#3�#3���Os�A%�%A4�3A4c�n�tjtj|��tj��jSr#)�re�compile�fnmatch�	translate�
IGNORECASE�	fullmatch�rL�patterns  r�compile_patternz#_FakeWindowsFlavour.compile_pattern�s$���:�g�/��8�8�"�-�H�H�R�Rr N)rjrkrlrmr�r�ntpath�pathmodrr	r�rr|r rrr�s�������	�	�

)�(�(�1�1�E�E�!�R�L�L�1�1�1�
2�1�1�E�E�!�R�L�L�1�1�1�
2�	�
��	N�	N�	N�	V�	V�	V�"!	�!	�!	�F	S�	S�	S�	S�	Sr rc�.�eZdZdZeZd�Zd�Zd�Zd�Z	dS)rz�Flavour used by PurePosixPath with some Unix specific implementations
        independent of FakeFilesystem properties.
        c��dS)NFr|r�s  rrz_FakePosixFlavour.is_reserved�s���5r c�D�t|��}dt|��zS)Nzfile://)�bytesr)rLr�bpaths   rr	z_FakePosixFlavour.make_uri�s#���$�K�K�E��2�5�9�9�9�9r c�(�|sR	tjdS#t$r2ddl}|�tj����jcYSwxYwddl}	|�|��jS#t$rtd|z���wxYw)Nr�rr�r�r�s   rr�z_FakePosixFlavour.gethomedir�r�r�c�X�tjtj|����jSr#)rrrrrrs  rrz!_FakePosixFlavour.compile_pattern�s ���:�g�/��8�8�9�9�C�Cr N)
rjrkrlrm�	posixpathrrr	r�rr|r rrr�sf������	�	���	�	�	�	:�	:�	:�	�	�	�&	D�	D�	D�	D�	Dr rc�B�eZdZdZdZd�Zejdd�dkred���Z	ed���Z
ejdkrdd	�Zd
�Zed���Z
ejdkrdd
�Zdd�Zd�Zd d�Zd�Zd!d�Zed���Zd�Zd�Zd�Zd"d�Zejdkr		d�Zd�ZdSdS)#rz�Replacement for pathlib.Path. Reimplement some methods to use
    fake filesystem. The rest of the methods work as they are, as they will
    use the fake accessor.
    New in pyfakefs 3.0.
    Nc���|tjur$|jjrtjntj}tjdkr|�|��St�
|��S)�)Creates the correct subclass based on OS.r)r�Pathrr��WindowsPath�	PosixPathrr�_from_parts�object�__new__��clsr'r(s   rr.zFakePath.__new__sh���#�(�(�(��>�/�1�!�-�-�&�0�
�
��g�%�%��?�?�4�(�(�(��>�>�#�&�&�&r r�rNc��t�|��}|���|�|��\}}}||_||_||_|Sr#)r-r.�_init�_parse_args�_drv�_root�_parts)r0r'rLr�r�r�s      rr,zFakePath._from_partssT���>�>�#�&�&�D��J�J�L�L�L�#�/�/��5�5��C��u��D�I��D�J��D�K��Kr c��t�|��}||_||_||_|���|Sr#)r-r.r4r5r6r2)r0r�r�r�rLs     r�_from_parsed_partszFakePath._from_parsed_partss:���>�>�#�&�&�D��D�I��D�J��D�K��J�J�L�L�L��Kr )r�c�,�t|_d|_dS)z#Initializer called from base class.FN)�_fake_accessor�	_accessor�_closed)rL�templates  rr2zFakePath._init(s��,�D�N� �D�L�L�Lr c� �t|��S)zSReturns the underlying path string as used by the fake
        filesystem.
        )r%ris r�_pathzFakePath._path/s���4�y�y�r c�,�||jj��S)zjReturn a new path pointing to the current working directory
        (as returned by os.getcwd()).
        )rr�)r0s rr�zFakePath.cwd5s��
�s�3�>�%�&�&�&r rc�r�tjdkr|�d}n|�td���d}|���|j�||���}|�5|���t|�����}|j	�
|��}t|��S)a�Make the path absolute, resolving all symlinks on the way and also
            normalizing it (for example turning slashes into backslashes
            under Windows).

            Args:
                strict: If False (default) no exception is raised if the path
                    does not exist.
                    New in Python 3.6.

            Raises:
                OSError: if the path doesn't exist (strict=True or Python < 3.6)
            )r�NFz5resolve() got an unexpected keyword argument 'strict'T)r�)rrrP�_raise_on_closedrr�rAr%�absoluter�absnormpathr)rLr�rs   rr�zFakePath.resolve>s�����6�)�)��>�"�F���%�#�O�������!�!�#�#�#��=�(�(��V�)���D��|��	�	�����4�=�=�?�?�+�+���?�.�.�t�4�4�D��D�>�>�!r �rr�c��|���t|j��|���|||||��S)z�Open the file pointed by this path and return a fake file object.

        Raises:
            OSError: if the target object is a directory, the path is invalid
                or permission is denied.
        )rDr	rr@)rLrG�	buffering�encoding�errors�newlines      r�openz
FakePath.open^sI��	
������,�|�D�O�,�,��J�J�L�L�$�	�8�V�W�
�
�	
r c��t|j��|���d���5}|���cddd��S#1swxYwYdS)z�Open the fake file in bytes mode, read it, and close the file.

        Raises:
            OSError: if the target object is a directory, the path is
                invalid or permission is denied.
        �rb�rGN�r	rr@�read)rL�fs  r�
read_byteszFakePath.read_bytesjs���+�\�$�/�
*�
*��J�J�L�L�t�
�
�
�	�
��6�6�8�8�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A�A�Ac���t|j��|���d||���5}|���cddd��S#1swxYwYdS)zO
        Open the fake file in text mode, read it, and close the file.
        rG)rGrJrKNrQ)rLrJrKrSs    r�	read_textzFakePath.read_textvs���+�\�$�/�
*�
*��J�J�L�L�s�X�f�
�
�
�	�
��6�6�8�8�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A�A�Ac���t|��}t|j��|���d���5}|�|��cddd��S#1swxYwYdS)a
Open the fake file in bytes mode, write to it, and close the file.
        Args:
            data: the bytes to be written
        Raises:
            OSError: if the target object is a directory, the path is
                invalid or permission is denied.
        �wbrPN)�
memoryviewr	rr@�write)rL�data�viewrSs    r�write_byteszFakePath.write_bytess����$����
*�\�$�/�
*�
*��J�J�L�L�t�
�
�
�	!�
��7�7�4�=�=�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!�	!�	!s�A#�#A'�*A'c�l�t|t��std|jjz���|�t
jdkrtd���t|j��|�	��d|||���5}|�
|��cddd��S#1swxYwYdS)atOpen the fake file in text mode, write to it, and close
        the file.

        Args:
            data: the string to be written
            encoding: the encoding used for the string; if not given, the
                default locale encoding is used
            errors: (str) Defines how encoding errors are handled.
            newline: Controls universal newlines, passed to stream object.
                New in Python 3.10.
        Raises:
            TypeError: if data is not of type 'str'.
            OSError: if the target object is a directory, the path is
                invalid or permission is denied.
        zdata must be str, not %sNrNz9write_text() got an unexpected keyword argument 'newline'�w)rGrJrKrL)�
isinstancer%rPr�rjrrr	rr@rZ)rLr[rJrKrLrSs      r�
write_textzFakePath.write_text�s�� �$��$�$�	R��6���9P�P�Q�Q�Q���3�#3�g�#=�#=��N���
�+�\�$�/�
*�
*��J�J�L�L�����
�
�
�	!���7�7�4�=�=�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!�	!�	!s�B)�)B-�0B-c�0�tj�d��}|jjtjdkkr�tj�|��d}|jjr"tj�dd|��}n tj�d|��}|j�|��s|j�	|��||�
tj|jj����S)zrReturn a new path pointing to the user's home directory (as
        returned by os.path.expanduser('~')).
        �~�ntr�zC:�Users�home)
rQr�
expanduserrr�r�r�rr��
create_dirrwr�r�)r0rfr�s   rrfz
FakePath.home�s���
�w�!�!�#�&�&���>�'�B�G�t�O�<�<��w�}�}�T�*�*�1�-�H��~�+�
6��w�|�|�D�'�8�<�<����w�|�|�F�H�5�5���>�(�(��.�.�
0���)�)�$�/�/�/��s�4�<�<�����(E�F�F�G�G�Gr c���|���}	|���}n*#t$r|j�|��}YnwxYw|j|jko|j|jkS)a/Return whether other_path is the same or not as this file
        (as returned by os.path.samefile()).

        Args:
            other_path: A path object or string of the file object
            to be compared with

        Raises:
            OSError: if the filesystem object doesn't exist.
        )rA�AttributeErrorr�st_ino�st_dev)rL�
other_path�st�other_sts    r�samefilezFakePath.samefile�sx���Y�Y�[�[��	8�!���(�(�H�H���	8�	8�	8���+�+�J�7�7�H�H�H�	8�����y�H�O�+�L��	�X�_�0L�Ls�+�$A�Ac���ttj�|������tjj|jj����S)zkReturn a new path with expanded ~ and ~user constructs
        (as returned by os.path.expanduser)
        )	rrQrrgr@rwr�rr�ris rrgzFakePath.expanduser�sO����G���t�z�z�|�|�,�,�4�4����T�_�;�
�
�
�
�	
r c�d�tjdkr|jr|���dSdSdS)N)r�	)rrr=�
_raise_closedris rrDzFakePath._raise_on_closed�s=����f�$�$���$���� � � � � �%�$�$�$r �Tc��|���|���rk|r0|j�|���d���dS|j�tj|�����dS|�d��}|�	��|�
|��dS)a�Create a fake file for the path with the given access mode,
        if it doesn't exist.

        Args:
            mode: the file mode for the file if it does not exist
            exist_ok: if the file already exists and this is True, nothing
                happens, otherwise FileExistError is raised

        Raises:
            FileExistsError: if the file exists and exits_ok is False.
        N)�timesr_)rDr�rr{r@r�r��EEXISTrM�closerF)rLrG�exist_ok�	fake_files    r�touchzFakePath.touch�s���	
�������;�;�=�=�	��
K���%�%�d�j�j�l�l�$�%�?�?�?�?�?���.�.�u�|�T�Z�Z�\�\�J�J�J�J�J��	�	�#���I��O�O�����J�J�t�����r c��|jjr|jo|jStj�|�����Sr#)rr�rr�rQr�isabsr@ris rr�zFakePath.is_absolute�s:����,�
0��z�/�d�i�/��7�=�=������.�.�.r c�T�|jjr|jsdS|jd�d��rdS|jd�d��d�d��d�d��}|���tjvS)NFrr�r�r�r�� )	rr��_tailr�r�rstripr�pathlib�_WIN_RESERVED_NAMES�rLr�s  rrzFakePath.is_reserved�s����?�0�
��
�
��u��z�!�}�'�'��/�/�
��u��:�b�>�+�+�C�0�0��3�=�=�c�B�B�1�E�L�L�S�Q�Q�D��:�:�<�<�7�#>�>�>r r#)rGr�NNN)NN)NNN)ruT)rjrkrlrmrr.rr�classmethodr,r8r2r@r�r�rMrTrVr]rarfrprgrDr|r�rr|r rrr�s����������J�'�'�'�������w�&�&�
�	�	�
��	�
�	�	�
��	���'�!�!�	!�	!�	!�	!�����'�'��[�'���'�!�!�	"�	"�	"�	"�@

�

�

�

�
�
�
�����
!�
!�
!�!�!�!�!�>�
H�
H��[�
H�M�M�M�$
�
�
�!�!�!�����.��7�"�"�	�	/�	/�	/�
	?�	?�	?�	?�	?�#�"r rc��eZdZdZd�ZGd�de��ZGd�de��ZGd�dee��Z	Gd	�d
ee��Z
eZd�ZdS)
raaUses FakeFilesystem to provide a fake pathlib module replacement.
    Can be used to replace both the standard `pathlib` module and the
    `pathlib2` package available on PyPi.

    You need a fake_filesystem to use this:
    `filesystem = fake_filesystem.FakeFilesystem()`
    `fake_pathlib_module = fake_filesystem.FakePathlibModule(filesystem)`
    c�<�t|��t|_dS)z�
        Initializes the module with the given filesystem.

        Args:
            filesystem: FakeFilesystem used to provide file system information
        N)rr��_pathlib_module�rLrs  rr�zFakePathlibModule.__init__s ��	�J����&����r c��eZdZdZdZdS)�FakePathlibModule.PurePosixPathzLA subclass of PurePath, that represents non-Windows filesystem
        pathsr|N�rjrkrlrm�	__slots__r|r rrr�s������	�	��	�	�	r rc��eZdZdZdZdS)�!FakePathlibModule.PureWindowsPath�@A subclass of PurePath, that represents Windows filesystem pathsr|Nr�r|r rrr�"�������N�N��	�	�	r rc�(�eZdZdZdZd�Zd�Zd�ZdS)�FakePathlibModule.WindowsPathzjA subclass of Path and PureWindowsPath that represents
        concrete Windows filesystem paths.
        r|c� �td���)Nz*Path.owner() is unsupported on this systemrIris r�ownerz#FakePathlibModule.WindowsPath.owner.���%�&R�S�S�Sr c� �td���)Nz*Path.group() is unsupported on this systemrIris r�groupz#FakePathlibModule.WindowsPath.group1r�r c� �td���)Nz-Path.is_mount() is unsupported on this systemrIris r�is_mountz&FakePathlibModule.WindowsPath.is_mount4s��%�&U�V�V�Vr N)rjrkrlrmr�r�r�r�r|r rr*r�'s]������	�	��	�	T�	T�	T�	T�	T�	T�	W�	W�	W�	W�	Wr r*c�"�eZdZdZdZd�Zd�ZdS)�FakePathlibModule.PosixPathzlA subclass of Path and PurePosixPath that represents
        concrete non-Windows filesystem paths.
        r|c�l�ddl}|�|���j��jS)z�Return the username of the file owner.
            It is assumed that `st_uid` is related to a real user,
            otherwise `KeyError` is raised.
            rN)r�r�rA�st_uid�pw_name)rLr�s  rr�z!FakePathlibModule.PosixPath.owner>�-��

�J�J�J��<�<��	�	��� 2�3�3�;�;r c�l�ddl}|�|���j��jS)z�Return the group name of the file group.
            It is assumed that `st_gid` is related to a real group,
            otherwise `KeyError` is raised.
            rN)�grp�getgrgidrA�st_gid�gr_name)rLr�s  rr�z!FakePathlibModule.PosixPath.groupGr�r N)rjrkrlrmr�r�r�r|r rr+r�7sC������	�	��	�	<�	<�	<�	<�	<�	<�	<�	<r r+c�,�t|j|��S�z:Forwards any unfaked calls to the standard pathlib module.��getattrr�r�s  r�__getattr__zFakePathlibModule.__getattr__R����t�+�T�2�2�2r N)
rjrkrlrmr�rrrrr*r+r)r�r|r rrrs���������'�'�'���������������(����
W�W�W�W�W�h��W�W�W� <�<�<�<�<�H�m�<�<�<�2�D�3�3�3�3�3r rc�@�eZdZdZdZdd�Zd�Zd�Zed���Z	dS)�FakePathlibPathModulezAPatches `pathlib.Path` by passing all calls to FakePathlibModule.Nc�J�|j�t|��|j_dSdSr#)�fake_pathlibrr�r�s  rr�zFakePathlibPathModule.__init__\s+����$�*;�J�*G�*G�D�N�'�'�'�%�$r c�&�|jj|i|��Sr#)r�r)�rLr'r(s   r�__call__zFakePathlibPathModule.__call__`s��%�t� �%�t�6�v�6�6�6r c�6�t|jj|��Sr#)r�r�r)r�s  rr�z!FakePathlibPathModule.__getattr__c����t�(�-�t�4�4�4r c�,�t|t��Sr#�r`r�r0�instances  r�__instancecheck__z'FakePathlibPathModule.__instancecheck__fs���(�H�-�-�-r r#)
rjrkrlrmr�r�r�r�r�r�r|r rr�r�Wsp������K�K��L�H�H�H�H�7�7�7�5�5�5��.�.��[�.�.�.r r�c��eZdZdZejdkr*ejdkrej	��nej
��Znejdkrene
Zd�ZdS)�RealPathz�Replacement for `pathlib.Path` if it shall not be faked.
    Needed because `Path` in `pathlib` is always faked, even if `pathlib`
    itself is not.
    rrdc���|tjur(tjdkrtjntj}tjdkr|�|��St�
|��S)r(rdr)�RealPathlibModuler)rQr�r*r+rrr,r-r.r/s   rr.zRealPath.__new__{sh���#�(�(�(��7�d�?�?�"�-�-�&�0�
�
��g�%�%��?�?�4�(�(�(��>�>�#�&�&�&r N)rjrkrlrmrrrQr�r��_WindowsFlavour�
_PosixFlavourrrr%r.r|r rr�r�ls���������
��'�!�!��w�$���
$�G�#�%�%�%�&��&�(�(�	�� �W��_�_�6�6�)��'�'�'�'�'r r�rNrS�returnc�F��tj����fd���}|S)zuDecorator used for real pathlib Path methods to ensure that
        real os functions instead of faked ones are used.c�d��t��5�|i|��cddd��S#1swxYwYdSr#)r)r'r(rSs  �r�wrappedz!with_original_os.<locals>.wrapped�s���� �"�"�
*�
*��q�$�)�&�)�)�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*����
*�
*�
*�
*�
*�
*s�%�)�))r,r-)rSr�s` r�with_original_osr��s:���
���	�	�	*�	*�	*�	*�
�	�	*��r �__c�>�eZdZdZdZed���Zd�Zd�Zd�Z	dS)�RealPathlibPathModulezAPatches `pathlib.Path` by passing all calls to RealPathlibModule.Nc�,�t|t��Sr#r�r�s  rr�z'RealPathlibPathModule.__instancecheck__�s���(�H�-�-�-r c�H�|j�t��|j_dSdSr#)�real_pathlibr�r�ris rr�zRealPathlibPathModule.__init__�s)����$�*;�*=�*=�D�N�'�'�'�%�$r c��t|i|��Sr#)r�r�s   rr�zRealPathlibPathModule.__call__�s����(��(�(�(r c�6�t|jj|��Sr#)r�r�r)r�s  rr�z!RealPathlibPathModule.__getattr__�r�r )
rjrkrlrmr�r�r�r�r�r�r|r rr�r��se������K�K��L��.�.��[�.�
>�>�>�)�)�)�5�5�5�5�5r r�c��eZdZdZd�ZGd�de��ZGd�de��Zej	dkrGd�d	e
e��ZnGd
�de
e��Ze
Z
d�Zd
S)r�z�Used to replace `pathlib` for skipped modules.
    As the original `pathlib` is always patched to use the fake path,
    we need to provide a version which does not do this.
    c��t|_dSr#)r�r�ris rr�zRealPathlibModule.__init__�s��&����r c��eZdZdZdZdS)�RealPathlibModule.PurePosixPathz>A subclass of PurePath, that represents Posix filesystem pathsr|Nr�r|r rrr��s������L�L��	�	�	r rc��eZdZdZdZdS)�!RealPathlibModule.PureWindowsPathr�r|Nr�r|r rrr��r�r r�win32c��eZdZdZdZdS)�RealPathlibModule.WindowsPathzrA subclass of Path and PureWindowsPath that represents
            concrete Windows filesystem paths.
            r|Nr�r|r rr*r���������
�
��I�I�Ir r*c��eZdZdZdZdS)�RealPathlibModule.PosixPathztA subclass of Path and PurePosixPath that represents
            concrete non-Windows filesystem paths.
            r|Nr�r|r rr+r��r�r r+c�,�t|j|��Sr�r�r�s  rr�zRealPathlibModule.__getattr__�r�r N)rjrkrlrmr�rrrr�platformr�r*r+r)r�r|r rr�r��s��������
'�'�'����������
�����(����
�|�w���	�	�	�	�	�(�O�	�	�	�	�	�	�	�	�	��-�	�	�	��D�3�3�3�3�3r r�)<rmr�rr,�inspectrrQr�r%rrr�typingr�urllib.parserr�pyfakefsr�pyfakefs.extra_packagesr�pyfakefs.fake_filesystemr�pyfakefs.fake_openr	�pyfakefs.fake_osr
r�pyfakefs.helpersrrr0r7r;�	_Accessor�accessorrjr-r=r;r�_Flavour�flavourr~rrr)rrr�r�r��
getmembers�
isfunctionr��fnr��setattrr�r�r|r r�<module>r�s!����$
����������������
�
�
�
�	�	�	�	���������	�	�	�	�
�
�
�
�������������@�@�@�@�@�@�!�!�!�!�!�!�/�/�/�/�/�/�3�3�3�3�3�3�+�+�+�+�+�+�:�:�:�:�:�:�:�:�$�$�$�$�$�$�
=�
=�
=� "�"�"�"�"�"�"�"�"��� �H�H�������H�H�H�����S0�S0�S0�S0�S0�H�S0�S0�S0�l�������g�����G�A�A�A�A�A�w�A�A�A�FOS�OS�OS�OS�OS�l�OS�OS�OS�b$D�$D�$D�$D�$D�L�$D�$D�$D�NL?�L?�L?�L?�L?�w�|�L?�L?�L?�^L3�L3�L3�L3�L3�L3�L3�L3�^.�.�.�.�.�.�.�.�*'�'�'�'�'�w�|�'�'�'�:��g���	�H�	��	�	�	�	�'�G�&�x��1C�D�D�:�:���b����t�$�$�	:��G�H�d�$4�$4�R�$8�$8�9�9�9��5�5�5�5�5�5�5�5�,)3�)3�)3�)3�)3�)3�)3�)3�)3�)3s�0A8�8B�B

Youez - 2016 - github.com/yon3zu
LinuXploit