Sindbad~EG File Manager
�
'Μgr����ddlZddlZddlZddlZddlZddlmZ eje�j�jjjdzj�ZGd�dej �Zed>idd�d d�d
d�dd�dd�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd��Zed>id d�d!d�d"d�d#d�d$d�d%d�d&d�d'd�d(d�d)d�d*d�d+d�d,d�d-d�d.d�d/d�d0d�d1d�d2d3�d4d3��ZGd5�d6e�ZGd7�d8�ZGd9�d:e�Zd?d;�Zd?d<�Zd=�Zy#e
$rddlmZe�ZY��wxYw)@�N)�verbosezModules/getpath.py)�get_getpath_codeobjectc���eZdZ�fd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
d �Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z�xZS)�MockGetPathTestsc�2��t�|�|i|��d|_y�N)�super�__init__�maxDiff)�self�a�kw� __class__s ��./usr/local/lib/python3.12/test/test_getpath.pyr
zMockGetPathTests.__init__s���
���!�"�r�"����c ��� tdd��}|jd�|jd�|jd�t dddddgd���}t||�}|j
||�y) N�C:\Python\python.exe��argv0�real_executable�C:\Python\Lib\os.py�C:\Python\DLLs� C:\Python���C:\Python\python98.zipr�
C:\Python\Libr��
executable�base_executable�prefix�exec_prefix�module_search_paths_set�module_search_paths��MockNTNamespace�add_known_xfile�add_known_file�
add_known_dir�dict�getpath�assertEqual�r�ns�expected�actuals r�test_normal_win32z"MockGetPathTests.test_normal_win32s���6�
�)�3�
�� ���2�3�
���0�1�
���*�+��.�3��$�$%�!�
����X�&������6�*rc��� tdd��}|jd�|jd�|jddg�tdddddddgd�� �}t ||�}|j||�y)
N�#C:\CPython\PCbuild\amd64\python.exer�C:\CPython\Lib\os.py�'C:\CPython\PCbuild\amd64\pybuilddir.txt��
C:\CPythonr�z%C:\CPython\PCbuild\amd64\python98.zipzC:\CPython\PCbuild\amd64�C:\CPython\Lib�rr r!r"�build_prefix�_is_python_buildr#r$�r&r'r(r*r+r,r-s r�test_buildtree_win32z%MockGetPathTests.test_buildtree_win320s���2�
�8�B�
�� ���A�B�
���1�2�
���D�r�d�K��=�B� �%�&��$%�!�
����X�&������6�*rc�6� tddd��}|jd�|jd�|jd�|jd�|jddg�t ddddddd gd
���}t||�}|j
||�y)NrzC:\venv\Scripts\python.exe)r�ENV___PYVENV_LAUNCHER__rrrzC:\venv\pyvenv.cfgzhome = C:\Pythonrrr�rr!r"r �base_prefix�base_exec_prefixr#r$r%r-s r�test_venv_win32z MockGetPathTests.test_venv_win32Js��� ��)�$A�3�
��
���2�3�
���8�9�
���0�1�
���*�+�
���/��2
� ��4��$�3�$�)�$%�!�
����X�&������6�*rc�� d}t|d|�d�d|�d�di�}tdd|��}|jd�|jd�|j d �td
gd���}t
||�}|j||�d
|dd<d
|dd<d|dd<td
gd���}t
||�}|j||�y)Nz1HKLM\Software\Python\PythonCore\9.8-XY\PythonPathz\Path1� path1-dirz
\Path1\Subdirznot-subdirsr)rr�winregrrr)rrFrrr)r#r$r�config�use_environmentr#r$r)�
MockWinregr&r'r(r)r*r+r,)r�hkeyrGr.r/r0s r�test_registry_win32z$MockGetPathTests.test_registry_win32os�� �
D����$��f�G��k��f�O�$�m�
���
�)�3��
��
���2�3�
���0�1�
���*�+��$%�!�
����X�&������6�*�*+��8��&�'�23��8��.�/�.2��8��*�+��$%�!�
����X�&������6�*rc �.� tdd��}|jd�|jd�|jdd�|jd�|j d�tdddddgd�� �}t
||�}|j||�y)
N�C:\LinkedFrom\python.exerrrrrrrr)r&r'�add_known_linkr(r)r*r+r,r-s r�test_symlink_normal_win32z*MockGetPathTests.test_symlink_normal_win32�s���B�
�-�3�
�� ���6�7�
���2�3�
���5�7N�O�
���0�1�
���*�+��2�7��$�$%�!�
����X�&������6�*rc�6� tdd��}|jd�|jd�|jdd�|jd�|jddg�t dddddddgd ��
�}t||�}|j
||�y)NrNr3rr4r5r6r7rr8r:)r&r'rOr(r*r+r,r-s r�test_symlink_buildtree_win32z-MockGetPathTests.test_symlink_buildtree_win32�s���>�
�-�B�
�� ���6�7�
���A�B�
���5�7]�^�
���1�2�
���D�r�d�K��2�7� �%�&��$%�!�
����X�&������6�*rc��� tddd��}|jd�|jd�|jddg�tdddddddgd ��
�}t ||�}|j||�y)NzC:\Out\python.exer7)rr�ENV_PYTHONHOMEr4zC:\Out\pybuilddir.txtr6zC:\r)zC:\Out\python98.zipzC:\Outr9r:r=r-s r�test_buildtree_pythonhome_win32z0MockGetPathTests.test_buildtree_pythonhome_win32�s���O�
�&�0�(�
��
���/�0�
���1�2�
���2�R�D�9��+�0� �%� ��$%�!�
��"��X�&������6�*rc ��� tdd��}|jd�|jd�tdddddgd���}t ||�}|j||�y)Nrrrrr)rrrrr=r-s r�test_no_dlls_win32z#MockGetPathTests.test_no_dlls_win32�sq��:�
�)�3�
�� ���2�3�
���0�1��.�3��$�$%�!�
����X�&������6�*rc ��� tddd��}|jd�|jd�|jd�t dddddgd ��
�}t||�}|j
||�y)N�/usr�pythonz/usr/bin)�PREFIXr�ENV_PATH�/usr/bin/python�/usr/lib/python9.8/os.py�/usr/lib/python9.8/lib-dynloadr�z/usr/lib/python98.zipz/usr/lib/python9.8r_r��MockPosixNamespacer'r(r)r*r+r,r-s r�test_normal_posixz"MockGetPathTests.test_normal_posixs���2�
����
��
���,�-�
���4�5�
���9�:��(�-���$%�!�
����X�&������6�*rc�4� tdd��}|jd�|jd�|jddg�|jd�|jd�t ddddd d
d
gd���}t||�}|j
||�y)
N�/home/cpython/python�
/usr/local�rr[�/usr/local/bin/python�/home/cpython/pybuilddir.txt�build/lib.linux-x86_64-9.8�/home/cpython/Lib/os.py�/home/cpython/lib-dynload�
/home/cpythonr��/usr/local/lib/python98.zip�/home/cpython/Libz(/home/cpython/build/lib.linux-x86_64-9.8�rr!r"r r;r<r#r$rar-s r�test_buildpath_posixz%MockGetPathTests.test_buildpath_posix%s��� � �)��
�� ���1�2�
���2�3�
���8�;W�:X�Y�
���3�4�
���4�5��-��$�2�(��$%�!�
����X�&������6�*rc�6� tddd��}|jd�|jd�|jd�|jd�|jd d
g�t dddddddgd��
�}t||�}|j
||�y)NrZrY�/venv/bin:/usr/bin�rr[r\r]�/venv/bin/pythonr^r_�/venv/pyvenv.cfg�home = /usr/binrr`rArar-s r�test_venv_posixz MockGetPathTests.test_venv_posixFs���%�
���)�
��
���,�-�
���-�.�
���4�5�
���9�:�
���,��/
� ��)���-��#�$%�!�
����X�&������6�*rc�Z� tddd��}|jd�|jd�|jdd�|jd�|j d�|jd d
g�tdddddddgd��
�}t
||�}|j||�y)NrZrYrtruz/usr/bin/python3rvr^r_rwrxrr`rA�rbr'rOr(r)r*r+r,r-s r�test_venv_changed_name_posixz-MockGetPathTests.test_venv_changed_name_posixes���%�
���)�
��
���-�.�
���-�.�
���,�.@�A�
���4�5�
���9�:�
���,��/
� ��)���.��#�$%�!�
����X�&������6�*rc�Z� tddd��}|jd�|jd�|jdd�|jd�|j d�|jdd g�tdd
d
dd
d
dgd��
�}t
||�}|j||�y)NrvrYrtruz!/path/to/non-installed/bin/pythonz*/path/to/non-installed/lib/python9.8/os.py�0/path/to/non-installed/lib/python9.8/lib-dynloadrwzhome = /path/to/non-installedz/path/to/non-installedr)z'/path/to/non-installed/lib/python98.zipz$/path/to/non-installed/lib/python9.8r~rAr{r-s r�&test_venv_non_installed_zip_path_posixz7MockGetPathTests.test_venv_non_installed_zip_path_posix�s���O�
�$��)�
��
���>�?�
���-�.�
���,�=� ?�
���F�G�
���K�L�
���,�,�/
� ��)�+�0�?�0�5�$%�!�
����X�&������6�*rc�6� tddd��}|jd�|jd�|jd�|jd�|jd d
g�t dddddddgd��
�}t||�}|j
||�y)NrZrYrtruz/usr/bin/python9rvr^r_rwrxrr`rArar-s r�!test_venv_changed_name_copy_posixz2MockGetPathTests.test_venv_changed_name_copy_posix�s���O�
���)�
��
���-�.�
���-�.�
���4�5�
���9�:�
���,��/
� ��)���.��#�$%�!�
����X�&������6�*rc �.� tdd��}|jd�|jd�|jdd�|jd�|j d�tdddddgd�� �}t
||�}|j||�y)
NrY�/linkfrom/python)r[rr]r^r_rr`rr{r-s r�test_symlink_normal_posixz*MockGetPathTests.test_symlink_normal_posix�s���>�
��$�
�� ���-�.�
���,�-�
���,�.?�@�
���4�5�
���9�:��)�.���$%�!�
����X�&������6�*rc�z� tdd��}|jd�|jd�|jdd�|jd�|jddg�|jd�|j d �tddddd
ddgd��
�}t
||�}|j||�y)Nr�rfrgrerhrirjrkrlrmrrnrqr{r-s r�test_symlink_buildpath_posixz-MockGetPathTests.test_symlink_buildpath_posix�s��� � �%��
�� ���-�.�
���1�2�
���,�.D�E�
���2�3�
���8�;W�:X�Y�
���3�4�
���4�5��)��$�.�(��$%�!�
����X�&������6�*rc ��� tddd��}|jd�|jd�|jd�t dddddgd ��
�}t||�}|j
||�y)NrYr��lib64)r[r�
PLATLIBDIRr]z/usr/lib64/python9.8/os.py� /usr/lib64/python9.8/lib-dynloadr)z/usr/lib64/python98.zipz/usr/lib64/python9.8r�rrar-s r�test_custom_platlibdir_posixz-MockGetPathTests.test_custom_platlibdir_posixs���8�
��$��
��
���,�-�
���6�7�
���;�<��)�.���$%�!�
����X�&������6�*rc�� tdddddddd��}|jd�|jd�|jd�|jd �t dddddddgd
���}t||�}|j
||�y)N�darwin�\/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Pythonr�1/Library/Frameworks/Python.framework/Versions/9.8�?/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8�8/Library/Frameworks/Python.framework/Versions/9.8/Python��os_namer�WITH_NEXT_FRAMEWORKr[�EXEC_PREFIXr@r�library�K/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload�E/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/os.py�zB/Library/Frameworks/Python.framework/Versions/9.8/lib/python98.zipz?/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8r�rA)rbr'r)r(r*r+r,r-s r�test_framework_macosz%MockGetPathTests.test_framework_macoss��� �
��p� !�F�K�$e�z�N�
�� ���y�z�
���\�]�
���f�g�
���a�b�
�X�F�K�]�K�P�$%�!�
����X�&������6�*rc�$� tddddddddddddd��
}|jd�|jd�|jd�|jd �tdddddddgd
���}t ||�}|j||�y)N�f/Library/Frameworks/DebugPython.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/DebugPythonr�r�6/Library/Frameworks/DebugPython.framework/Versions/9.8�D/Library/Frameworks/DebugPython.framework/Versions/9.8/bin/python9.8�B/Library/Frameworks/DebugPython.framework/Versions/9.8/DebugPython)
rr�r�r[r�r@rr��
PYTHONPATHrT�ENV_PYTHONEXECUTABLE�executable_dir�
py_setpath�P/Library/Frameworks/DebugPython.framework/Versions/9.8/lib/python9.8/lib-dynload�J/Library/Frameworks/DebugPython.framework/Versions/9.8/lib/python9.8/os.py�zG/Library/Frameworks/DebugPython.framework/Versions/9.8/lib/python98.zipzD/Library/Frameworks/DebugPython.framework/Versions/9.8/lib/python9.8r�rA)rbr'r)r*r+r,r-s r�test_alt_framework_macosz)MockGetPathTests.test_alt_framework_macosDs��� � �z�� !�K�P�$j�E�X���!%���
�� ���D� E�
���a�b�
���k�l�
���g�h��]�K�P�b�P�U�$%�!�
����X�&������6�*rc�� d}tddddd|�d�dd��}|j|�|j|�d ��|j|�d
��|j|�d��|j|�d��|jd�|jd�|jd
�|jd�|j|�d�dg�t |�d�ddddddgd���}t||�}|j
||�y)N�/tmp/workdir/venvr�r�rr��/bin/pythonr�r��/bin�/lib�/lib/python9.8r�r�r��/pyvenv.cfgz<home = /Library/Frameworks/Python.framework/Versions/9.8/binr�rA�rbr)r'r(r*r+r,�r� venv_pathr.r/r0s r�test_venv_framework_macosz*MockGetPathTests.test_venv_framework_macosss?�� �'� �
��p� !�F�K�'0�k��$=�z�N�
�� ����#�
���I�;�d�+�,�
���I�;�d�+�,�
���I�;�n�5�6�
���i�[��4�5�
���y�z�
���\�]�
���f�g�
���b�c�
���Y�K�{�3�J�6
� ��#��K�0�F�K�]�K�P�$%�!�
����X�&������6�*rc�� d}tddddd|�d�dd��}|j|�|j|�d ��|j|�d
��|j|�d��|j|�d��|jd�|jd�|jd
�|jd�|j|�d�dg�t |�d�ddddddgd���}t||�}|j
||�y)Nr�r�r�rr�r�r�r�r�r�r�r�r�r�r�zAhome = /Library/Frameworks/DebugPython.framework/Versions/9.8/binr�rAr�r�s r�test_venv_alt_framework_macosz.MockGetPathTests.test_venv_alt_framework_macos�sJ�� �(� �
��z� !�K�P�'0�k��$=�E�X�
�� ����#�
���I�;�d�+�,�
���I�;�d�+�,�
���I�;�n�5�6�
���i�[��4�5�
���D� E�
���a�b�
���k�l�
���g�h�
���Y�K�{�3�O�6
� ��#��K�0�K�P�b�P�U�$%�!�
����X�&������6�*rc�:� tddddd��}|jd�|jd�|jd�|jd�|jdd g�t ddddddd
gd���}t||�}|j
||�y)
Nr�r]rYz/framework/Python9.8/python)r�rr[r@rr^r_z/framework/Python9.8/pyvenv.cfgrxrr`rArar-s r�test_venv_macosz MockGetPathTests.test_venv_macos�s��� �
��#��$A�-�
�� ���,�-�
���8�9�
���4�5�
���9�:�
���;��>
� ��4���-��#�$%�!�
����X�&������6�*rc �4� tddddd��}|jd�|jd�|jdd�|jd�|j d �tddddd
gd���}t
||�}|j||�y)
Nr�rYrZ�/linkfrom:/usr/binr�)r�r[rr\rr]r^r_rr`rr{r-s r�test_symlink_normal_macosz*MockGetPathTests.test_symlink_normal_macos�s���?�
����)�.�
�� ���-�.�
���,�-�
���,�.?�@�
���4�5�
���9�:��)�.���$%�!�
����X�&������6�*rc�� tddddd��}|jd�|jd�|jdd�|jd�|jd d
g�|jd�|j d�tddddd
ddgd���}t
||�}|j||�y)Nr�rZr�rfr�)r�rr\r[rrerhrizbuild/lib.macos-9.8rkrlrmr)rorpz!/home/cpython/build/lib.macos-9.8rqr{r-s r�test_symlink_buildpath_macosz-MockGetPathTests.test_symlink_buildpath_macoss��� � ���)��.�
�� ���-�.�
���1�2�
���,�.D�E�
���2�3�
���8�;P�:Q�R�
���3�4�
���4�5��)��$�.�(��$%�!�
����X�&������6�*r)�__name__�
__module__�__qualname__r
r1r>rDrLrPrRrUrWrcrrryr|rr�r�r�r�r�r�r�r�r�r�r��
__classcell__�rs@rrrs�����+�2+�4#+�J/+�b+�6+�8+�<+�.+�2+�B+�>+�@+�B+�>+�4!+�F+�2'+�R-+�^)+�V++�Z#+�J+�<%+rrr[r6r�r��VPATHr��
PYDEBUGEXT�
VERSION_MAJOR� �
VERSION_MINOR��PYWINVER�
EXE_SUFFIXr\rTr�r@rr�rr�r�rGr;�venv_prefix�home�
platlibdir�
pythonpath�program_namer!r"rBrCrr �
stdlib_dir�platstdlib_dirr$r#�pythonpath_env�argv� orig_argv�isolatedrIr�use_sitec���eZdZddd��fd�
Zdd�Zd�Zd�Zd�Zd�Zd �Z d
�Z
d�Zd�Zd
�Z
d�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Z�xZS)r&N�rrHc�.��|jt�tj�|d<d|d<d|d<d|d<d|d <t �|�|i|��|r |g|dd
<|r|dj|�i|_i|_t�|_ g|_
y)NrH�ntr��DLLsr�z9.8-XYr�z..\..r�r�)�update�DEFAULT_NAMESPACE�DEFAULT_CONFIG�copyr r
�_files�_links�set�_dirs� _warnings�rrrHr
rrs �rr
zMockNTNamespace.__init__ks�������%�&�'�,�,�.��X����Y��#��\��#��Z�� ��W�
�
���!�"�r�"��+0�'�D��N�;�'����N�!�!�&�)��������U��
���rc��t|xsd�|j|j�<|j|j d�d�y)N��\r)�listr��casefoldr)�
rpartition�r�path�liness rr(zMockNTNamespace.add_known_file|s;��'+�E�K�R�'8����D�M�M�O�$����4�?�?�4�0��3�4rc�&�|j|�yr)r(�rr�s rr'zMockNTNamespace.add_known_xfile�s�����D�!rc�>�||j|j�<yr)r�r��rr��targets rrOzMockNTNamespace.add_known_link�s��'-����D�M�M�O�$rc��|jd�j�}|r3|jj|�|j d�d}|r�2yy)Nr�r)�rstripr�r��addr��rr��ps rr)zMockNTNamespace.add_known_dir�sD���K�K���&�&�(����J�J�N�N�1�����T�"�1�%�A�rc�N� t||�S#t$r
t|�d�wxYwr��getattr�AttributeError�KeyError�r�keys r�__missing__zMockNTNamespace.__missing__��/�� *��4��%�%��� *��3�-�T�)� *����$c�L�|j|�r|S|jd|�S)NzC:\Absolute��isabs�joinpathr�s r�abspathzMockNTNamespace.abspath�s$���:�:�d���K��}�}�^�T�2�2rc�*�|jd�dS)Nr���r�r�s r�basenamezMockNTNamespace.basename�s�����t�$�Q�'�'rc�f�|jd�jd�d}|dddk(r|dzS|S)Nr�rr�:�r�r�)rr��names r�dirnamezMockNTNamespace.dirname�s<���{�{�4� �+�+�D�1�!�4�����8�s�?��$�;���rc�\�|j�j|j��Sr)r��endswith�rr��suffixs r� hassuffixzMockNTNamespace.hassuffix�s ���}�}��'�'����(9�:�:rc��|dddk(S)Nr�z:\r�r�s rrzMockNTNamespace.isabs�s���A�a�y�E�!�!rc�`�tr
td|d�|j�|jvS�N�Check ifzis a dir)r�printr�r�r�s r�isdirzMockNTNamespace.isdir�s&����*�d�J�/��}�}��$�*�*�,�,rc�`�tr
td|d�|j�|jvS�Nrz is a file)rrr�r�r�s r�isfilezMockNTNamespace.isfile�s&����*�d�K�0��}�}��$�+�+�-�-rc��tr
td|d�|j�}||jvxr%|j d�ddj�k(S�Nrzis a module�.r�py�rrr�r�r�r�s r�ismodulezMockNTNamespace.ismodule�sI����*�d�M�2��}�}����t�{�{�"�Q�t���s�';�A�'>�$�-�-�/�'Q�Qrc��tr
td|d�|j�}||jvxr%|j d�ddj�k(S)Nrzis a executabler r�exer"r�s r�isxfilezMockNTNamespace.isxfile�sK����*�d�$5�6��}�}����t�{�{�"�R�t���s�';�A�'>�%�.�.�BR�'R�Rrc�L�tjtj|��Sr)�ntpath�normpath�joinr�s rrzMockNTNamespace.joinpath�s�����v�{�{�D�1�2�2rc�p� |j|j�S#t$r
t|�d�wxYwr)r�r�r��FileNotFoundErrorr�s r� readlineszMockNTNamespace.readlines�s8�� 4��;�;�t�}�}��/�/��� 4�#�D�)�t�3� 4�s��5c�:�trtd|� |j|j�}|�t�}n|j�|vrt
d��|j|j��|j||�S#t$r|cYSwxYw�NzRead link fromz
circular link) rrr�r�r�r��OSErrorr��realpath�rr��_trail�links rr1zMockNTNamespace.realpath�s�����"�D�)� ��;�;�t�}�}��/�D��>��U�F�
�]�]�_��
&��/�*�*��
�
�4�=�=�?�#��}�}�T�6�*�*��� ��K� �s�B�B�Bc�^�|jj|�trt|�yyr�r��appendrr�r�messages r�warnzMockNTNamespace.warn��#�������g�&���'�N�rr�r�r�r�r
r(r'rOr)r�rr rrrrrr#r&rr-r1r:r�r�s@rr&r&jsi���!%�d��"5�"�.�&�*�3�
(��;�"�-�
.�
R�S�3�4�+�rr&c�D�eZdZdZdZd�Zd�Zd�Zd�Zd�Z d�Z
d �Zd
�Zy)rJ�HKLM�HKCUc��|j�D��cic]\}}|j�|��c}}|_i|_ycc}}wr)�itemsr��keys�open)rrB�k�vs rr
zMockWinreg.__init__�s8��15����>����A�Q�Z�Z�\�1�_��>�� ��� ��?s�Ac��y)Nz<MockWinreg>r��rs r�__repr__zMockWinreg.__repr__�s��rc�,�t|t|��Sr)�
isinstance�type)r�others r�__eq__zMockWinreg.__eq__�s���%��d��,�,rc�,�t|j�Sr)r�rCrGs r� open_keyszMockWinreg.open_keys�s���D�I�I��rc���trtd|�d|�d��|�d|��j�}||jvr.|jj|d�dz|j|<|St
��)Nz
OpenKeyEx(�, �)r�rr)rrr�rBrC�getr,)rrK�subkeyr�s r� OpenKeyExzMockWinreg.OpenKeyEx�sp����J�t�f�B�v�h�a�0�1���b���!�*�*�,���$�)�)��!�Y�Y�]�]�3��2�Q�6�D�I�I�c�N��J��!�!rc���trtd|�d��|j�}||jvrt d��|j|xxdzcc<|j|s|j|=yy)Nz CloseKey(rR�key is not openr)rrr�rC�RuntimeError)rrKs r�CloseKeyzMockWinreg.CloseKey�sf����I�d�V�1�%�&��}�}����t�y�y� ��0�1�1�� � �$��1����y�y���� � �$��rc��trtd|�d|�d��|j�}||jvrt d��|�d�}t|j�D�cgc]"}|j|�s�|t|�d��$}}|D�cgc] }d|vs�|��c}|ddt|�D]\}}||k(s�|j|�cStd��cc}wcc}w)NzEnumKey(rQrRrWr�zend of enumeration)rrr�rCrX�sortedrB�
startswith�len� enumerate�removeprefixr0)rrK�ir!rD�subkeys�j�ns r�EnumKeyzMockWinreg.EnumKey�s�����H�T�F�"�Q�C�q�)�*��}�}����t�y�y� ��0�1�1��6����,2�4�9�9�,=�V�,=�q����f�AU�1�S��[�\�?�,=��V�!(�:��A�D��M�a��:���
��g�&�D�A�q��A�v��~�~�f�-�-�'��*�+�+��W��:s�C�5C� C�Cc��trtd|�d|�d��|j�}||jvrt d��|r|j�}|�d|��} |j
|S#t$rt��wxYw)NzQueryValue(rQrRrWr�)rrr�rCrXrBr�r0)rrKrTs r�
QueryValuezMockWinreg.QueryValues�����K��v�R��x�q�1�2��}�}����t�y�y� ��0�1�1���_�_�&�F��V�2�f�X�&�D� ��9�9�T�?�"��� ��)�O� �s�A+�+A?N)
r�r�r��HKEY_LOCAL_MACHINE�HKEY_CURRENT_USERr
rHrMrOrUrYrdrfr�rrrJrJ�s6��������-��"� �,�rrJc���eZdZddd��fd�
Zdd�Zd�Zd�Zd�Zd�Zd �Z d
�Z
d�Zd�Zd
�Z
d�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Z�xZS)rbNr�c�B��|jt�tj�|d<d|d<d|d<d|d<t �|�|i|��|r |g|dd<|r|dj|�i|_t�|_i|_ t�|_
g|_y) NrH�posixr��libr�rr�r�)r�r�r�r�r r
r�r��_xfilesr�r�r�r�s �rr
zMockPosixNamespace.__init__s�������%�&�'�,�,�.��X��!��Y��"��\��&'��
"�#�
���!�"�r�"��+0�'�D��N�;�'����N�!�!�&�)�����u�������U��
���rc��t|xsd�|j|<|j|jd�d�y)Nr��/r)r�r�r)r�r�s rr(z!MockPosixNamespace.add_known_file,s5�� ���"�-����D�����4�?�?�3�/��2�3rc�\�|j|�|jj|�yr)r(rmr�r�s rr'z"MockPosixNamespace.add_known_xfile0s"�����D�!�������rc�"�||j|<yr)r�r�s rrOz!MockPosixNamespace.add_known_link4s��"����D�rc��|jd�}|r3|jj|�|jd�d}|r�2yy�Nror)r�r�r�r�r�s rr)z MockPosixNamespace.add_known_dir7s;���K�K������J�J�N�N�1�����S�!�!�$�A�rc�N� t||�S#t$r
t|�d�wxYwrr�r�s rr�zMockPosixNamespace.__missing__=r�rc�L�|j|�r|S|jd|�S)Nz /Absoluterr�s rrzMockPosixNamespace.abspathCs$���:�:�d���K��}�}�[�$�/�/rc�*�|jd�dS)Nrorrr�s rr zMockPosixNamespace.basenameHs�����s�#�A�&�&rc�H�|jd�jd�dSrsrr�s rrzMockPosixNamespace.dirnameKs!���{�{�3��*�*�3�/��2�2rc�$�|j|�Sr)rrs rrzMockPosixNamespace.hassuffixNs���}�}�V�$�$rc��|dddk(S)Nrrror�r�s rrzMockPosixNamespace.isabsQs���A�a�y�C��rc�D�tr
td|d�||jvSr)rrr�r�s rrzMockPosixNamespace.isdirTs ����*�d�J�/��t�z�z�!�!rc�D�tr
td|d�||jvSr)rrr�r�s rrzMockPosixNamespace.isfileYs ����*�d�K�0��t�{�{�"�"rc�v�tr
td|d�||jvxr|jd�ddk(Sr)rrr�r�r�s rr#zMockPosixNamespace.ismodule^s8����*�d�M�2��t�{�{�"�F�t���s�';�A�'>�$�'F�Frc�D�tr
td|d�||jvS)Nrzis an xfile)rrrmr�s rr&zMockPosixNamespace.isxfilecs ����*�d�M�2��t�|�|�#�#rc�L�tjtj|��Sr)� posixpathr)r*r�s rrzMockPosixNamespace.joinpathhs���!�!�)�.�.�$�"7�8�8rc�T� |j|S#t$r
t|�d�wxYwr)r�r�r,r�s rr-zMockPosixNamespace.readlinesks2�� 4��;�;�t�$�$��� 4�#�D�)�t�3� 4�s��'c���trtd|� |j|}|�t �}n||vrtd��|j
|�|j||�S#t$r|cYSwxYwr/)rrr�r�r�r0r�r1r2s rr1zMockPosixNamespace.realpathqsv����"�D�)� ��;�;�t�$�D��>��U�F�
�V�^��/�*�*��
�
�4���}�}�T�6�*�*��� ��K� �s�A"�"A0�/A0c�^�|jj|�trt|�yyrr6r8s rr:zMockPosixNamespace.warnr;rrr<r�s@rrbrbsh���!%�d��"4��#�%�*�0�
'�3�%� �"�
#�
G�
$�
9�4�+�rrbc
���g}t|�D]P}|dddk(r�|dk(rt||||d���&||vs�+||||k7s�7|j|||||f��R|sytd�|D��}dt |�dz|zz}t
rg|D]a\}}}|r.t
dj||j|�|||���7t
d j||j|�|���cyy)
Nr�__rH�r!c3�:K�|]\}}}t|����y�wr�r])�.0rD�_s r� <genexpr>zdiff_dict.<locals>.<genexpr>�s����+�d�7�1�a���A��d�s�� rz{}.{} -{!r}
{} +{!r}z{}.{} +{!r}) r[� diff_dictr7�maxr]rr�format�ljust) �before�afterr!�diffrD�max_k�indent�br
s rr�r��s��
�D�
�F�^���R�a�5�D�=����=��f�Q�i��q��(�;����:�%��(�f�Q�i�/��K�K��F�1�I�u�Q�x�0�1�����+�d�+�+�E�
�C��K�!�O�e�+�
,�F���G�A�q�!���-�4�4�V�Q�W�W�U�^�Q�PV�XY�Z�[��m�*�*�6�1�7�7�5�>�1�E�F� �rc
��tr|sytd�|D��}t|j�d���D]�\}}|dddk(r�|dk(rt ||||d���) |||k7r0tdj
||j|�|||���b td j
||j|�|����y#t$rY�9wxYw)
Nc3�2K�|]}t|����y�wrr�)r�rDs rr�zdump_dict.<locals>.<genexpr>�s����&��1��A���s�c��|dS)Nrr�)r`s r�<lambda>zdump_dict.<locals>.<lambda>�s��A�a�Dr)r�rr�rHr�z{}.{} {!r} (was {!r})z
{}.{} {!r}) rr�r[rA� dump_dictrr�r�r�)r�r�r!r�rDrEs rr�r��s����%���&��&�&�E��u�{�{�}�.�9���1��R�a�5�D�=����=��f�Q�i��q��(�;�� ��F�1�I�~��-�4�4�V�Q�W�W�U�^�Q�PV�WX�PY�Z�[���
�l�!�!�&�!�'�'�%�.�!�<�=�:��� �� �s�"7C � C�Cc�@�tj|�}d} tt|�d}|r
t ||�n
t||� |D�cic](}||dj
||j
|d����*c}S#|r
t ||�wt||�wxYwcc}w)NTFrH.)r��deepcopy�exec�SOURCEr�r�rS)r.rBr��failedrDs rr+r+�s���
�]�]�2�
�F�
�F�"��V�R������f�b�!��f�b�!����A�
�2�h�<���A�r�v�v�a��~�.�.����� ��f�b�!��f�b�!��s�A;�-B�;Br�)�global)r�r(�pathlibr�unittest�test.supportr�Path�__file__�absolute�parent�
read_bytesr�r,�_testinternalcapir�TestCaserr*r�r�r&rJrbr�r�r+r�rr�<module>r�sv���
���� �&��g�l�l�8�$�-�-�/�6�6�=�=�D�D�G[�[�
g�
g�
i�F�a+�x�(�(�a+�L��
������
� �
���
�����������������
�!�"�#�$�%�&�'�(
�)�*�+�,�-�.�/��4��
������� �
���
�������������������
�!�"�#�&�'�(�)�*�+��0l�d�l�^>�>�Bh��h�VG�,>�&��E%�&�8�
#�
%�F�&�s�AD6�6E�
E
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists