Your IP : 3.139.79.187


Current Path : /opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/__pycache__/webbrowser.cpython-311.opt-2.pyc

�

c��f=b����	ddlZddlZddlZddlZddlZddlZddlZgd�ZGd�de��Z	ej
��ZiZda
dad3dd�d�Zd3d�Zd4d
�Zd�Zd�Zdd�d
�ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZeZGd�de��ZGd �d!e��Z Gd"�d#e��Z!Gd$�d%e��Z"d&�Z#d'�Z$ej%dd(�d)krGd*�d+e��Z&ej%d,krGd-�d.e��Z'Gd/�d0e��Z(d1�Z)e*d2kre)��dSdS)5�N)�Error�open�open_new�open_new_tab�get�registerc��eZdZdS)rN)�__name__�
__module__�__qualname__���1/opt/alt/python311/lib64/python3.11/webbrowser.pyrrs�������DrrF��	preferredc�>�	t5t�t��||gt|���<|st
r%|t
vrt�d|��nt�|��ddd��dS#1swxYwYdS)Nr)�_lock�	_tryorder�register_standard_browsers�	_browsers�lower�_os_preferred_browser�insert�append)�name�klass�instancers    rrrs���'�	�#�#���&�(�(�(�#(�(�"3�	�$�*�*�,�,��
�	#�.�	#�4�;P�3P�3P����Q��%�%�%�%����T�"�"�"�#�#�#�#�#�#�#�#�#�#�#�#����#�#�#�#�#�#s�A<B�B�Bc�0�	t�4t5t�t��ddd��n#1swxYwY|�|g}nt}|D]�}d|vrJtj|��}|ddkrt|dd���cSt
|��cS	t|���}n#t$rt|��}YnwxYw|d�
|dcS|d�|d��cS��td���)N�%s����&�rz!could not locate runnable browser)rrr�shlex�split�BackgroundBrowser�GenericBrowserrr�KeyError�_synthesizer)�using�alternatives�browser�commands    rrr&s���M���
�	-�	-�� �*�,�,�,�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-�
���w��� ���$�$���7�?�?��k�'�*�*�G��r�{�c�!�!�(���"���6�6�6�6�6�%�g�.�.�.�.�.�
/�#�G�M�M�O�O�4�����
/�
/�
/�%�g�.�.����
/�����q�z�%��q�z�!�!�!����'�!�w�q�z�|�|�#�#�#�(�
�3�
4�
4�4s�2�6�6�B=�=C�CTc���	t�4t5t�t��ddd��n#1swxYwYtD]+}t|��}|�|||��rdS�,dS)NTF)rrrrr)�url�new�	autoraiserr+s     rrrHs������
�	-�	-�� �*�,�,�,�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-������d�)�)���<�<��S�)�,�,�	��4�4�	��5s�2�6�6c�$�	t|d��S�Nr"�r�r.s rrr[������Q�<�<�rc�$�	t|d��S�N�r3r4s rrrbr5rc��	|���d}tj|��sddgStj�|��}	t|���}n#t$rddgcYSwxYw|d}|rx|���|jkr[ddl	}|�	|��}||_
tj�|��|_t|d||���d|gSddgS)Nrr")rr)r$�shutil�which�os�path�basenamerrr'�copyrr)r+r�cmdrr,�
controllerr?s       rr(r(js��
��-�-�/�/�!�
�C��<������d�|��
�7���C� � �D���D�J�J�L�L�)���������d�|�����������J��"�d�j�j�l�l�j�&9�9�9������Y�Y�z�*�*�
�!�
�� �g�.�.�w�7�7�
����$��y�I�I�I�I��j�!�!��$�<�s�A4�4B�Bc�2�eZdZ	dgZd
d�Zdd�Zd�Zd�Zd	S)�BaseBrowserr�c�"�||_||_dS�N)rr>��selfrs  r�__init__zBaseBrowser.__init__�s����	���
�
�
rrTc��t�rF)�NotImplementedError�rHr.r/r0s    rrzBaseBrowser.open�s��!�!rc�.�|�|d��Sr2r3�rHr.s  rrzBaseBrowser.open_new�����y�y��a� � � rc�.�|�|d��Sr7r3rNs  rrzBaseBrowser.open_new_tab�rOrN)rD�rT)r
rr�argsrIrrrr
rrrCrC�sd������=��6�D�����"�"�"�"�!�!�!�!�!�!�!�!rrCc��eZdZ	d�Zdd�ZdS)r&c���t|t��r||_dg|_n|d|_|dd�|_tj�|j��|_dS)Nrrr")�
isinstance�strrrRr<r=r>rGs  rrIzGenericBrowser.__init__�s_���d�C� � �	!��D�I���D�I�I��Q��D�I��Q�R�R��D�I���(�(���3�3��
�
�
rrTc�:��tjd���|jg�fd�|jD��z}	tjdd�dkrtj|��}ntj|d���}|���S#t$rYdSwxYw)N�webbrowser.openc�<��g|]}|�d�����S�r��replace��.0�argr.s  �r�
<listcomp>z'GenericBrowser.open.<locals>.<listcomp>��7���!7�!7�!7�%(�"%���T�3�!7�!7�!7�!7�!7r��winT)�	close_fdsF)	�sys�auditrrR�platform�
subprocess�Popen�wait�OSError�rHr.r/r0�cmdline�ps `    rrzGenericBrowser.open�s�����	�#�S�)�)�)��9�+�!7�!7�!7�!7�,0�I�!7�!7�!7�7��	��|�B�Q�B��5�(�(��$�W�-�-����$�W��=�=�=���v�v�x�x�<����	�	�	��5�5�	���s�AB�
B�BNrQ�r
rrrIrr
rrr&r&�s<������,�4�4�4������rr&c��eZdZ	dd�ZdS)r%rTc�>��|jg�fd�|jD��z}tjd���	tjdd�dkrtj|��}ntj|dd���}|���duS#t$rYdSwxYw)Nc�<��g|]}|�d�����SrZr[r]s  �rr`z*BackgroundBrowser.open.<locals>.<listcomp>�rarrXrbrcT)rd�start_new_sessionF)	rrRrerfrgrhri�pollrkrls `    rrzBackgroundBrowser.open�s�����9�+�!7�!7�!7�!7�,0�I�!7�!7�!7�7���	�#�S�)�)�)�	��|�B�Q�B��5�(�(��$�W�-�-����$�W��7;�=�=�=���F�F�H�H��$�%���	�	�	��5�5�	���s�AB�
B�BNrQ�r
rrrr
rrr%r%�s-������������rr%c�@�eZdZ	dZdZdZddgZdZdZdZ	d	d�Z
d
d�ZdS)�UnixBrowserNFT�%actionrc��g}|r(|jr!t|��}|j|}|r|g}|jg|z|z}|s|jr
tj}nd}t	j|d||jr|pd|d���}	|r/	|	�d��}
|
S#tj	$rYdSwxYw|jr|	�
���dSdS|	���S)NT�rd�stdin�stdout�stderrrs�F)�
raise_opts�intr�
backgroundrh�DEVNULLri�redirect_stdoutrj�TimeoutExpiredrt)rHrR�remoter0r.�	raise_opt�optrm�inoutrn�rcs           r�_invokezUnixBrowser._invoke�s!���	��	&�d�o�	&��I���I��/�)�,�C��%���I��9�+�	�)�D�0���	�T�_�	��&�E�E��E���W��E�%)�%9�%C�e�%K�t�$)�T�
C�
C�
C���	 �
��V�V�A�Y�Y���v�
���,�
�
�
��t�t�
����
�_�	 ��v�v�x�x���t��u��v�v�x�x�<�s�9B�B$�#B$rc����tjd���|dkr|j�n@|dkr|j�n2|dkr|j�|j�n|j�ntdd|zz�����fd�|jD��}d�|D��}|�|d	|���}|s*�fd
�|jD��}|�|dd��Sd	S)NrXrr"r8zBad 'new' parameter to open(); zexpected 0, 1, or 2, got %sc�d��g|],}|�d����d�����-S)rrxr[)r^r_�actionr.s  ��rr`z$UnixBrowser.open.<locals>.<listcomp>sG���-�-�-�����D�#�&�&�.�.�y�&�A�A�-�-�-rc��g|]}|�|��Sr
r
)r^r_s  rr`z$UnixBrowser.open.<locals>.<listcomp>s��+�+�+��s�+��+�+�+rTc�<��g|]}|�d�����SrZr[r]s  �rr`z$UnixBrowser.open.<locals>.<listcomp>s'���@�@�@�s�C�K�K��c�*�*�@�@�@rF)	rerf�
remote_action�remote_action_newwin�remote_action_newtabr�remote_argsr�rR)rHr.r/r0rR�successr�s `    @rrzUnixBrowser.opens�����	�#�S�)�)�)��!�8�8��'�F�F�
�A�X�X��.�F�F�
�A�X�X��(�0��2����2����9�5��;�<�=�=�
=�-�-�-�-�-��+�-�-�-��+�+�t�+�+�+���,�,�t�T�9�c�:�:���	�@�@�@�@�d�i�@�@�@�D��<�<��e�U�3�3�3��4rrFrQ)r
rrrr�r�r�r�r�r�r�rr
rrrwrw�sl������G��J��J��O��d�#�K��M�����! �! �! �! �F�����rrwc�(�eZdZ	ddgZdZdZdZdZdS)�MozillarxrrDz-new-windowz-new-tabTN�r
rrr�r�r�r�r�r
rrr�r�s1������.��d�#�K��M�(��%���J�J�Jrr�c�0�eZdZ	ddgZddgZdZdZdZdZd	S)
�Netscape�-noraisez-raise�-remote�openURL(%s%action)rD�,new-window�,new-tabTN)	r
rrrr�r�r�r�r�r
rrr�r�'s<������.��h�'�J��2�3�K��M�(��%���J�J�Jrr�c�,�eZdZ	ddgZddgZdZdZdZdS)	�Galeonr�rDrxr�-nz-wTN)r
rrrr�r�r�r�r
rrr�r�2s5������6��b�!�J��d�#�K��M����J�J�Jrr�c�(�eZdZ	ddgZdZdZdZdZdS)�ChromerxrrD�--new-windowTNr�r
rrr�r�<s1������/��d�#�K��M�)�����J�J�Jrr�c�(�eZdZ	ddgZdZdZdZdZdS)�OperarxrrDr�TNr�r
rrr�r�Hs1������'��d�#�K��M�)�����J�J�Jrr�c�,�eZdZ	ddgZdZdZdZdZdZdS)�Elinksr�r�rDr�r�FN)	r
rrr�r�r�r�r�r�r
rrr�r�Rs9������)��2�3�K��M�(��%���J��O�O�Orr�c��eZdZ	dd�ZdS)�	KonquerorrTc���tjd|��|dkrd}nd}tj}	tjd||gd|||���}|���dS#t$rYnwxYw	tjdd	|gd|||d�
��}|����dSn#t$rYnwxYw	tjdd|gd|||d�
��}|���duS#t$rYd
SwxYw)NrXr8�newTab�openURL�	kfmclientT)rdr{r|r}�	konquerorz--silentrz�kfmz-dF)rerfrhr�rirjrkrt)rHr.r/r0r��devnullrns       rrzKonqueror.opengss���	�#�S�)�)�)��!�8�8��F�F��F��$��
	�� �+�v�s�!;�+/�w�(/��A�A�A�A�
�F�F�H�H�H��4��
�	�	�	��D�	����	�� �+�z�3�!?�+/�w�(/��37�9�9�9�A��v�v�x�x���t� ��	�	�	�	��D�	����	&�� �%��s�!3�+/�w�(/��37�9�9�9�A��F�F�H�H��$�%���	�	�	��5�5�	���s5�A � 
A-�,A-�1B%�%
B2�1B2�6C)�)
C7�6C7NrQrur
rrr�r�`s-�������+&�+&�+&�+&�+&�+&rr�c�"�eZdZd�Zd�Zdd�ZdS)�Grailc��ddl}ddl}ddl}ddl}tj�|���d��}|�t	j	����d}tj�|�
|��|�
|��dz��}|�|��}|sdS|�|j|j��}	|D]Q}
	|	�
|
��|	cS#t$r)	t	j|
��n#t$rYnwxYwY�NwxYwdS)Nrz.grail-unixz-*)�glob�pwd�socket�tempfiler<r=�join�
gettempdir�getpwuid�getuid�escape�AF_UNIX�SOCK_STREAM�connectrk�unlink)rHr�r�r�r��tempdir�user�filename�maybes�s�fns           r�_find_grail_rczGrail._find_grail_rc�s[�������
�
�
��
�
�
������'�,�,�x�2�2�4�4�,�.�.���|�|�B�I�K�K�(�(��+���7�<�<����G� 4� 4�d�k�k�$�6G�6G�$�6N�O�O�����8�$�$���	��4��M�M�&�.�&�*<�=�=���	�	�B�	
��	�	�"�
�
�
�������
�
�
���I�b�M�M�M�M�������D�������	
����		�	s6�6D�
E�D/�.E�/
D<�9E�;D<�<E�Ec��|���}|sdS|�|��|���dS)Nrr")r��send�close)rHr�r�s   r�_remotez
Grail._remote�sA�����!�!���	��1�	���v����	���	�	�	��qrrTc��tjd|��|r|�d|z��}n|�d|z��}|S)NrXzLOADNEW zLOAD )rerfr�)rHr.r/r0�oks     rrz
Grail.open�sO���	�#�S�)�)�)��	-����j�3�.�/�/�B�B����g��m�,�,�B��	rNrQ)r
rrr�r�rr
rrr�r��sF���������4��������rr�c�Z�tjd��rtddtd����tjd��r tddtgd�����dtjvr2tjd��rtddtd����dtjvr7tjd��r#tdtt
d����tjd��rtddtd����d	D]4}tj|��rt|dt|�����5d
D]4}tj|��rt|dt|�����5tjd��r$tdtt
d����n7tjd��r#tdtt
d����d
D]4}tj|��rt|dt|�����5tjd��rtddtd����dD]4}tj|��rt|dt|�����5tjd��rtddtd����tjd��rtddtd����tjd��rtdtd��dSdS)Nzxdg-open�gio)r�rz--r�GNOME_DESKTOP_SESSION_IDz	gvfs-open�KDE_FULL_SESSIONr�z
x-www-browser)�firefox�	iceweasel�iceape�	seamonkey)zmozilla-firefoxzmozilla-firebird�firebird�mozilla�netscaper�r�)�galeon�epiphany�	skipstone)z
google-chrome�chrome�chromiumzchromium-browser�opera�mosaic�grail)
r:r;rr%r<�environr�r�r�r�r�r�r�)r+s r�register_X_browsersr��s ���|�J���B���T�#4�Z�#@�#@�A�A�A��|�E���N����/�0K�0K�0K�L�L�M�M�M�"�R�Z�/�/�F�L��4M�4M�/���d�$5�k�$B�$B�C�C�C��R�Z�'�'�F�L��,E�,E�'���i��;�)?�)?�@�@�@�
�|�O�$�$�L���$�(9�/�(J�(J�K�K�K�C�6�6���<�� � �	6��W�d�G�G�$4�$4�5�5�5��+�7�7���<�� � �	7��W�d�H�W�$5�$5�6�6�6���|�E���A���	�9�U�#3�#3�4�4�4�4�	��k�	"�	"�A���i��;�)?�)?�@�@�@�*�5�5���<�� � �	5��W�d�F�7�O�O�4�4�4���|�K� � �D���d�$5�k�$B�$B�C�C�C�O�5�5���<�� � �	5��W�d�F�7�O�O�4�4�4���|�G���0���$��g���/�/�/��|�H���>���4�!2�8�!<�!<�=�=�=��|�G���'���%��&�&�&�&�&�'�'rc���gatjdkrxtddt	d����tddt	d����tddt	d����tddt	d����tjdkrtddtd����tjdd	�d
kr�tdt��tj�	tj
�dd
��d��}dddddd|fD]4}tj
|��rt|dt|�����5�n�tj
�d��stj
�d��r�	d���}tj|tj���}|������}|an(#t*tjt.t0f$rYnwxYwt3��tj
�d��r�tj
d��rtddt5d����tj
d��rtddt5d����tj
d��rtddt7d����tj
d��rtddt5d����tj
d��rtddt5d����dtj
vr�tj
d�tj��}|���|D]C}|dkr9t=|d �!��}|d"� t|dt5|��d �!���BdSdS)#N�darwin�MacOSX�defaultr�r��safari�
serenityos�Browserrbrczwindows-default�PROGRAMFILESzC:\Program FileszInternet Explorer\IEXPLORE.EXEr�r�r�r�r��DISPLAY�WAYLAND_DISPLAYz$xdg-settings get default-web-browser)r}�TERMzwww-browser�links�elinks�lynx�w3m�BROWSERrDTrr")rrergr�MacOSXOSAScriptr%�WindowsDefaultr<r=r�r�rr:r;r$rh�check_outputr��decode�stripr�FileNotFoundError�CalledProcessError�PermissionError�NotADirectoryErrorr�r&r��pathsep�reverser()�iexplorer+r@�
raw_result�result�userchoicesrms       rrr
s����I�
�|�x�����4���!;�!;�<�<�<���4���!:�!:�;�;�;���D�/�)�"<�"<�=�=�=���4���!:�!:�;�;�;��|�|�#�#���D�"3�I�">�">�?�?�?�
�|�B�Q�B��5� � ��"�N�3�3�3��7�<�<��
���~�?R� S� S� A�C�C��!�:�{�I�"�G�X�7�	D�	D�G��|�G�$�$�
D���$�(9�'�(B�(B�C�C�C��	D��:�>�>�)�$�$�	"��
���7H�(I�(I�	"�
/�<�B�B�D�D��'�4�S��AS�T�T�T�
�#�*�*�,�,�2�2�4�4��
)/�%�%��	&�z�'D�o�Wi�j�
�
�
���
����
 �!�!�!��:�>�>�&�!�!�
	=��|�M�*�*�
M����n�]�.K�.K�L�L�L��|�G�$�$�
A���$��w�(?�(?�@�@�@��|�H�%�%�
;���4���)9�)9�:�:�:��|�F�#�#�
?����~�f�'=�'=�>�>�>��|�E�"�"�
=����n�U�&;�&;�<�<�<��B�J����j��+�1�1�"�*�=�=��������#�	U�	U�G��"�}�}�!�'�T�:�:�:���q�6�>��W�d�N�7�,C�,C�t�T�T�T�T����	U�	Us�#AH�"H%�$H%rbrcc��eZdZdd�ZdS)r�rTc�|�tjd|��	tj|��dS#t$rYdSwxYw)NrXTF)rerfr<�	startfilerkrLs    rrzWindowsDefault.open^sW���I�'��-�-�-�
���S�!�!�!��t���
�
�
��u�u�
���s�-�
;�;NrQrur
rrr�r�]s(������		�		�		�		�		�		rr�r�c��eZdZ	d�Zdd�ZdS)r�c�f�tj|jj�d�td���||_dS)Nz3 is deprecated in 3.11 use MacOSXOSAScript instead.r8��
stacklevel��warnings�warn�	__class__r
�DeprecationWarningrrGs  rrIzMacOSX.__init__ysF���M�T�^�4�:�:�:�;M�Z[�
]�
]�
]�
]��D�I�I�IrrTc���tjd|��d|vrd|z}tt|����}|jdkrd|�dd��z}n@|jdkrd	}nd
|dz
z}d|�dd��z}d
|j�d|�d|�d�}t
jdd��}|�dS|�|��|�	��}|S)NrX�:zfile:r��open location "%s"�"�%22�OmniWebrDztoWindow %dr"zOpenURL "%s"ztell application "zK"
                                activate
                                � z%
                            end tell�	osascript�wF)
rerfr��boolrr\r<�popen�writer�)	rHr.r/r0�script�toWindowr@�osapiper�s	         rrzMacOSX.open~s���I�'��-�-�-��#�:�:��c�k���d�3�i�i�.�.�C��y�I�%�%�-����C��0G�0G�G����9�	�)�)�!�H�H� -��a��8�H�$�s�{�{�3��'>�'>�>���,0�9�9�9�c�c�c�8�8�8�E��
�h�{�C�0�0�G����u��M�M�&�!�!�!������B��6�MrNrQror
rrr�r�os<������	�	�	�	�
 	� 	� 	� 	� 	� 	rr�c�^��eZdZd�fd�	Zed���Zejd���Zd	d�Z�xZS)
r�r�c�J��t���|��dSrF)�superrI)rHrr
s  �rrIzMacOSXOSAScript.__init__�s!����G�G���T�"�"�"�"�"rc�|�tj|jj�d|jj�d�td���|jS�Nz!._name is deprecated in 3.11 use z.name instead.r8rr
)rHs r�_namezMacOSXOSAScript._name�sW���M�T�^�4�J�J�"&�.�"9�J�J�J�,��
<�
<�
<�
<��9�rc��tj|jj�d|jj�d�td���||_dSr"r
)rH�vals  rr#zMacOSXOSAScript._name�sZ���M�T�^�4�J�J�"&�.�"9�J�J�J�,��
<�
<�
<�
<��D�I�I�IrrTc�@�tjd|��|jdkrd|�dd��z}n d|j|�dd��fz}t	jdd��}|�d	S|�|��|���}|S)
NrXr�rrrz�
                   tell application "%s"
                       activate
                       open location "%s"
                   end
                   rrF)rerfrr\r<rrr�)rHr.r/r0rrr�s       rrzMacOSXOSAScript.open�s����I�'��-�-�-��y�I�%�%�-����C��0G�0G�G����
�	�3�;�;�s�E�#:�#:�;�<���h�{�C�0�0�G����u��M�M�&�!�!�!������B��6�Mr)r�rQ)	r
rrrI�propertyr#�setterr�
__classcell__)r
s@rr�r��s��������	#�	#�	#�	#�	#�	#�
�	�	�
��	�
��	�	�
��	�	�	�	�	�	�	�	�	rr�c�\�ddl}dtjdz}	|�tjdd�d��\}}na#|j$rT}t	|tj���t	|tj���tjd��Yd}~nd}~wwxYwd}|D]\}}|dkrd}�|dkrd}�t|��dkr/t	|tj���tjd��|d}t||��t	d	��dS)
NrzDUsage: %s [-n | -t] url
    -n: open new window
    -t: open new tabr"�ntd)�filer�z-tr8�)	�getoptre�argv�error�printr}�exit�lenr)	r.�usage�optsrR�msg�new_win�o�ar.s	         r�mainr:�s:���M�M�M�
��(�1�+�
&�E���]�]�3�8�A�B�B�<��7�7�
��d�d���<����
�c��
�#�#�#�#�
�e�#�*�%�%�%�%���������������������G��$�$���1���9�9��g�g�
�$�Y�Y�!���
�4�y�y�A�~�~�
�e�#�*�%�%�%�%�������
�q�'�C���g����	�$�K�K�K�K�Ks�+A�
B%�A
B � B%�__main__rFrQ)+r<r#r:rerh�	threadingr�__all__�	Exceptionr�RLockrrrrrrrrrr(�objectrCr&r%rwr�r�r�r��Chromiumr�r�r�r�r�rrgr�r�r�r:r
r
rr�<module>rBs8��E�
�	�	�	�����
�
�
�
�
�
�
�
�������������
J�
J�
J��	�	�	�	�	�I�	�	�	�	�	������	��	���
#�e�
#�
#�
#�
#�
#�5�5�5�5�D����&������',������D!�!�!�!�!�&�!�!�!�&�����[����8���������&L�L�L�L�L�+�L�L�L�^�����k���������{���������[���������[�����������K���������[����2&�2&�2&�2&�2&��2&�2&�2&�j,�,�,�,�,�K�,�,�,�l@'�@'�@'�DFU�FU�FU�^�<�����u���
�
�
�
�
��
�
�
� �<�8���/�/�/�/�/��/�/�/�b$�$�$�$�$�+�$�$�$�N���0�z����D�F�F�F�F�F��r

?>