Hacked By AnonymousFox

Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/webbrowser.cpython-312.opt-2.pyc

�

�Q�f�\��f�	ddlZddlZddlZddlZddlZddlZddlZgd�ZGd�de�Z	ej�ZiZda
dad0dd�d�Zd0d�Zd1d	�Zd
�Zd�Zdd�d�ZGd
�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZeZGd�de�ZGd�de�ZGd�d e�Z Gd!�d"e�Z!d#�Z"d$�Z#ejHdd%d&k(rGd'�d(e�Z%ejHd)k(rGd*�d+e�Z&Gd,�d-e�Z'd.�Z(e)d/k(re(�yy)2�N)�Error�open�open_new�open_new_tab�get�registerc��eZdZy)rN)�__name__�
__module__�__qualname__���1/opt/alt/python312/lib64/python3.12/webbrowser.pyrrs��rrF��	preferredc��	t5t�
t�||gt|j	�<|st
r#|�d�t
k(rtj
d|�ntj|�ddd�y#1swYyxYw)Nz.desktopr)�_lock�	_tryorder�register_standard_browsers�	_browsers�lower�_os_preferred_browser�insert�append)�name�klass�instancers    rrrsh��'�	���&�(�#(�(�"3�	�$�*�*�,��
�.�d�V�8�3D�H]�3]����Q��%����T�"�
���s�A*A;�;Bc��	t�t5t�
t�ddd�|�|g}nt}|D]u}d|vr:tj|�}|ddk(rt|dd�cSt
|�cS	t|j�}|d�|dcS|d��k|d�cStd��#1swY��xYw#t$rt|�}Y�LwxYw)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�k�'�*�G��r�{�c�!�(���"��6�6�%�g�.�.�
/�#�G�M�M�O�4���q�z�%��q�z�!����'�!�w�q�z�|�#�# �$�3�
4�4�3�U��&�
/�%�g�.��
/�s�B8�7C�8C�C�Cc��	t�t5t�
t�ddd�tD]"}t|�}|j	|||�s�"yy#1swY�5xYw)NTF)rrrrr)�url�new�	autoraiserr+s     rrrHsX��
���
�� �*�,�����d�)���<�<��S�)�,�����U�s�A�Ac��	t|d�S�Nr"�r�r.s rrr^������Q�<�rc��	t|d�S�N�r3r4s rrrer5rc���	|j�d}tj|�sddgStjj|�}	t|j�}|d}|rp|j�|j
k(rSddl	}|j|�}||_
tjj|�|_t|d||��d|gSddgS#t$rddgcYSwxYw)Nrr")rr)r$�shutil�which�os�path�basenamerrr'�copyrr)r+r�cmdrr,�
controllerr?s       rr(r(ms���
��-�-�/�!�
�C��<�<����d�|��
�7�7���C� �D���D�J�J�L�)�����J��d�j�j�l�j�&9�&9�9���Y�Y�z�*�
�!�
�� �g�g�.�.�w�7�
����$��y�I��j�!�!��$�<������d�|���s�C � 
C0�/C0c�0�eZdZ	dgZdd�Zdd�Zd�Zd�Zy)	�BaseBrowserrc� �||_||_y�N)rr>��selfrs  r�__init__zBaseBrowser.__init__�s����	���
rc��t�rE)�NotImplementedError�rGr.r/r0s    rrzBaseBrowser.open�s��!�!rc�&�|j|d�Sr2r3�rGr.s  rrzBaseBrowser.open_new�����y�y��a� � rc�&�|j|d�Sr7r3rMs  rrzBaseBrowser.open_new_tab�rNrN)��rT)r
rr�argsrHrrrr
rrrCrC�s ��=��6�D��"�!�!rrCc��eZdZ	d�Zdd�Zy)r&c���t|t�r||_dg|_n|d|_|dd|_tj
j
|j�|_y)Nrrr")�
isinstance�strrrRr<r=r>rFs  rrHzGenericBrowser.__init__�sP���d�C� ��D�I���D�I��Q��D�I��Q�R��D�I����(�(����3��
rc�p�tjd|�|jg|jD�cgc]}|j	d|���c}z}	tj
dddk(rt
j|�}nt
j|d��}|j�Scc}w#t$rYywxYw)N�webbrowser.openr��winT)�	close_fdsF)
�sys�auditrrR�replace�platform�
subprocess�Popen�wait�OSError�rGr.r/r0�arg�cmdline�ps       rrzGenericBrowser.open�s����	�	�#�S�)��9�9�+�,0�I�I�!7�,5�S�"%���T�3�!7�,5�!7�7��	��|�|�B�Q��5�(��$�$�W�-���$�$�W��=���v�v�x�<���!7���	��	�s�B$�AB)�)	B5�4B5NrQ�r
rrrHrr
rrr&r&�s��,�4�rr&c��eZdZ	dd�Zy)r%c�t�|jg|jD�cgc]}|jd|���c}z}tjd|�	tj
dddk(rt
j|�}nt
j|dd��}|j�duScc}w#t$rYywxYw)NrrXrYrZT)r[�start_new_sessionF)
rrRr^r\r]r_r`ra�pollrcrds       rrzBackgroundBrowser.open�s����9�9�+�,0�I�I�!7�,5�S�"%���T�3�!7�,5�!7�7���	�	�#�S�)�	��|�|�B�Q��5�(��$�$�W�-���$�$�W��7;�=���F�F�H��$�%��!7���	��	�s�B&�AB+�+	B7�6B7NrQ�r
rrrr
rrr%r%�s���rr%c�>�eZdZ	dZdZdZddgZdZdZdZ	dd�Z
d	d�Zy)
�UnixBrowserNFT�%actionrc���g}|r+|jrt|�}|j|}|r|g}|jg|z|z}|s|jrtj
}nd}t	j|d||jxr|xsd|d��}	|r	|	jd�}
|
S|jr|	j��yy|	j�S#tj$rYywxYw)NT�r[�stdin�stdout�stderrrk�F)�
raise_opts�intr�
backgroundr`�DEVNULLra�redirect_stdoutrb�TimeoutExpiredrl)rGrR�remoter0r.�	raise_opt�optrf�inoutrg�rcs           r�_invokezUnixBrowser._invoke�s����	��d�o�o��I��I��/�/�)�,�C����I��9�9�+�	�)�D�0���T�_�_��&�&�E��E����W��E�%)�%9�%9�%C�e�%K�t�$)�T�
C���
��V�V�A�Y���v�
��_�_��v�v�x�����v�v�x�<����,�,�
��
�s�C�C-�,C-c�H�tjd|�|dk(r
|j}nN|dk(r
|j}n<|dk(r&|j�
|j}n|j}ntdd|zz��|jD�cgc]$}|jd|�jd|���&}}|D�cgc]}|s�|��	}}|j|d	||�}|s<|jD�cgc]}|jd|���}}|j|d
d
�Sy	cc}wcc}wcc}w)NrXrr"r8zBad 'new' parameter to open(); zexpected 0, 1, or 2, got %srrpTF)
r\r]�
remote_action�remote_action_newwin�remote_action_newtabr�remote_argsr^r�rR)rGr.r/r0�actionrerR�successs        rrzUnixBrowser.opens/���	�	�#�S�)��!�8��'�'�F�
�A�X��.�.�F�
�A�X��(�(�0��2�2���2�2���9�5��;�<�=�
=� �+�+�-�+�C����D�#�&�.�.�y�&�A�+�	
�-�#�+�t��s��t��+��,�,�t�T�9�c�:���6:�i�i�@�i�s�C�K�K��c�*�i�D�@��<�<��e�U�3�3���-��+��As�)D�4D�<D�&DrErQ)r
rrrwryr{r�r�r�r�r�rr
rrroro�s<��G��J��J��O��d�#�K��M�����! �Frroc�&�eZdZ	ddgZdZdZdZdZy)�MozillarprrPz-new-windowz-new-tabTN�r
rrr�r�r�r�ryr
rrr�r� s%��.��d�#�K��M�(��%���Jrr�c�*�eZdZ	ddgZddgZdZdZdZy)	�Epiphanyz-noraiserPrpr�-nz-wTN)r
rrrwr�r�r�ryr
rrr�r�*s)��.��b�!�J��d�#�K��M����Jrr�c�&�eZdZ	ddgZdZdZdZdZy)�ChromerprrP�--new-windowTNr�r
rrr�r�4s%��/��d�#�K��M�)�����Jrr�c�&�eZdZ	ddgZdZdZdZdZy)�OperarprrPr�TNr�r
rrr�r�@s%��'��d�#�K��M�)�����Jrr�c�*�eZdZ	ddgZdZdZdZdZdZy)�Elinksz-remotezopenURL(%s%action)rPz,new-windowz,new-tabFN)	r
rrr�r�r�r�ryr{r
rrr�r�Js-��)��2�3�K��M�(��%���J��Orr�c��eZdZ	dd�Zy)�	Konquerorc���tjd|�|dk(rd}nd}tj}	tjd||gd|||��}|j�y#t$rYnwxYw	tjdd	|gd|||d�
�}|j��y#t$rYnwxYw	tjdd|gd|||d�
�}|j�duS#t$rYy
wxYw)NrXr8�newTab�openURL�	kfmclientT)r[rsrtru�	konquerorz--silentrr�kfmz-dF)r\r]r`rzrarbrcrl)rGr.r/r0r��devnullrgs       rrzKonqueror.open_s���	�	�#�S�)��!�8��F��F��$�$��
	�� � �+�v�s�!;�+/�w�(/��A�A�
�F�F�H���
�	��	��	�� � �+�z�3�!?�+/�w�(/��37�9�A��v�v�x����
�	��	��	&�� � �%��s�!3�+/�w�(/��37�9�A��F�F�H��$�%���	��	�s5�A � 	A,�+A,�0B�	B+�*B+�/C�	C+�*C+NrQrmr
rrr�r�Xs���+&rr�c�&�eZdZ	ddgZdZdZdZdZy)�EdgerprrPr�TNr�r
rrr�r��s%��0��d�#�K��M�)�����Jrr�c��tjd�rtddtd��tjd�rtddtgd���dtj
vr+tjd�rtddtd��dtj
vr/tjd�rtdtt
d��tjd�rtddtd��d	D].}tj|�s�t|dt|���0tjd
�rtd
tt
d
��n/tjd�rtdtt
d��tjd�rtddtd��d
D].}tj|�s�t|dt|���0tjd�rtddtd��tjd�rtddtd��yy)Nzxdg-open�gio)r�rz--r�GNOME_DESKTOP_SESSION_IDz	gvfs-open�KDE_FULL_SESSIONr�z
x-www-browser)�firefox�	iceweasel�	seamonkeyzmozilla-firefox�mozillar�r��epiphany)z
google-chrome�chrome�chromiumzchromium-browser�opera�microsoft-edge)r:r;rr%r<�environr�r�r�r�r�r�)r+s r�register_X_browsersr��s����|�|�J����T�#4�Z�#@�A��|�|�E�����/�0K�L�M�"�R�Z�Z�/�F�L�L��4M���d�$5�k�$B�C��R�Z�Z�'�F�L�L��,E���i��;�)?�@��|�|�O�$���$�(9�/�(J�K����<�<�� ��W�d�G�G�$4�5���|�|�E����	�9�U�#3�4�	���k�	"���i��;�)?�@��|�|�J����T�8�J�#7�8�O���<�<�� ��W�d�F�7�O�4�O�
�|�|�G����$��g��/��|�|�$�%��!�4��.>�)?�@�&rc���gatjdk(rXtddt	d��tddt	d��tddt	d��tddt	d��tjdk(rtddtd��tjdd	d
k(r�tdt�tjjtjjdd
�d�}tjjtjjdd�d�}ddddd||fD].}tj|�s�t|dt|���0tjd��r�tddtd���n�tjjd�stjjd�r`	dj�}t!j"|t j$��}|j'�j)�}|at5�tjjd�r�tjd�rtddt7d��tjd�rtddt7d��tjd�rtddt9d��tjd�rtddt7d��tjd�rtddt7d��d tjvrytjd jtj:�}|j=�|D]3}|d!k7s�	t?|d"�#�}|d$��t|dt7|�d"�#��5yy#t,t j.t0t2f$rY���wxYw)%N�darwin�MacOSX�defaultr�r��safari�
serenityos�BrowserrYrZzwindows-defaultzPROGRAMFILES(x86)zC:\Program Files (x86)z%Microsoft\Edge\Application\msedge.exe�PROGRAMFILESzC:\Program Filesr�r�r�zMicrosoftEdge.exer��DISPLAY�WAYLAND_DISPLAYz$xdg-settings get default-web-browser)ru�TERMzwww-browser�links�elinks�lynx�w3m�BROWSERrPTrr") rr\r_r�MacOSXOSAScriptr%�WindowsDefaultr<r=�joinr�rr:r;r�r$r`�check_outputrz�decode�stripr�FileNotFoundError�CalledProcessError�PermissionError�NotADirectoryErrorr�r&r��pathsep�reverser()�edge64�edge32r+r@�
raw_result�result�userchoicesrfs        rrr�s����I�
�|�|�x����4���!;�<���4���!:�;���D�/�)�"<�=���4���!:�;��|�|�|�#���D�"3�I�">�?�
�|�|�B�Q��5� ��"�N�3������b�j�j�n�n�-@�B[�\�H�J�������b�j�j�n�n�^�=P�Q�H�J��!�;�	�8����1�G��|�|�G�$���$�(9�'�(B�C�1��<�<�+�,��%�t�T�2E�-F�G��:�:�>�>�)�$��
�
���7H�(I�
/�<�B�B�D��'�4�4�S��AS�AS�T�
�#�*�*�,�2�2�4��
)/�%��!��:�:�>�>�&�!��|�|�M�*����n�]�.K�L��|�|�G�$���$��w�(?�@��|�|�H�%���4���)9�:��|�|�F�#����~�f�'=�>��|�|�E�"����n�U�&;�<��B�J�J���j�j��+�1�1�"�*�*�=������#�G��"�}�!�'�T�:���q�6�>��W�d�N�7�,C�t�T�	#�
��7&�z�'D�'D�o�Wi�j�
��
�s� AO�#O(�'O(rYrZc��eZdZdd�Zy)r�c�z�tjd|�	tj|�y#t$rYywxYw)NrXTF)r\r]r<�	startfilercrKs    rrzWindowsDefault.open+s=���I�I�'��-�
����S�!����
��
�s�.�	:�:NrQrmr
rrr�r�*s��		rr�r�c��eZdZ	d�Zdd�Zy)r�c�x�tj|jj�d�td��||_y)Nz3 is deprecated in 3.11 use MacOSXOSAScript instead.r8��
stacklevel��warnings�warn�	__class__r
�DeprecationWarningrrFs  rrHzMacOSX.__init__Fs5���M�M�T�^�^�4�4�5�6:�:�;M�Z[�
]��D�Irc��tjd|�d|vrd|z}tt|��}|jdk(rd|jdd�z}nE|jdk(rd	}nd
|dz
z}d|jdd�z}d
|j�d|�d|�d�}t
jdd�}|�y|j|�|j�}|S)NrX�:zfile:r��open location "%s"�"�%22�OmniWebrPztoWindow %dr"zOpenURL "%s"ztell application "zK"
                                activate
                                � z%
                            end tell�	osascript�wF)
r\r]rx�boolrr^r<�popen�write�close)	rGr.r/r0�script�toWindowr@�osapiper�s	         rrzMacOSX.openKs����I�I�'��-��#�:��c�k���d�3�i�.�C��y�y�I�%�-����C��0G�G���9�9�	�)�!�H� -��a��8�H�$�s�{�{�3��'>�>��,0�9�9�c�8�E��
�h�h�{�C�0�G�����M�M�&�!�����B��6�MrNrQrhr
rrr�r�<s��	�	�
 	rr�c�\��eZdZd�fd�	Zed��Zejd��Zdd�Z�xZS)r�c�$��t�|�|�yrE)�superrH)rGrr�s  �rrHzMacOSXOSAScript.__init__ns����G��T�"rc��tj|jj�d|jj�d�td��|j
S�Nz!._name is deprecated in 3.11 use z.name instead.r8r�r�)rGs r�_namezMacOSXOSAScript._nameqsK���M�M�T�^�^�4�4�5�6"�"&�.�.�"9�"9�!:�.�J�,��
<��9�9�rc��tj|jj�d|jj�d�td��||_yr�r�)rG�vals  rr�zMacOSXOSAScript._namexsH���M�M�T�^�^�4�4�5�6"�"&�.�.�"9�"9�!:�.�J�,��
<��D�Irc�4�tjd|�|jdk(rd|jdd�z}n!d|j|jdd�fz}t	j
dd�}|�y	|j
|�|j�}|S)
NrXr�r�r�r�z�
                   tell application "%s"
                       activate
                       open location "%s"
                   end
                   r�r�F)r\r]rr^r<r�r�r�)rGr.r/r0r�r�r�s       rrzMacOSXOSAScript.opens����I�I�'��-��y�y�I�%�-����C��0G�G���
�	�	�3�;�;�s�E�#:�;�<���h�h�{�C�0�G�����M�M�&�!�����B��6�Mr)r�rQ)	r
rrrH�propertyr��setterr�
__classcell__)r�s@rr�r�ms9���	#�
�	�
�	�
���	�
�	�	rr�c��ddl}dtjdz}	|jtjddddg�\}}d}D]O\}}|dk(rd}�|dk(rd	}�|d
k(s|dk(s�!t	|tj
��tj��Qt�dk7r0t	|tj
��tjd�|d}t||�t	d�y#|j$rV}t	|tj
��t	|tj
��tjd�Yd}~��d}~wwxYw)
NrzcUsage: %s [-n | -t | -h] url
    -n: open new window
    -t: open new tab
    -h, --help: show helpr"�ntdh�help)�filer�z-tr8z-hz--help�)	�getoptr\�argv�error�printru�exit�lenr)	r��usage�optsrR�msg�new_win�o�ar.s	         r�mainr�s���
� #�x�x��{�
+�E���]�]�3�8�8�A�B�<����A�
��d�
�G����1���9��g�
�$�Y�!��
�$�Y�!�x�-��%�c�j�j�)��H�H�J���4�y�A�~�
�e�#�*�*�%������
�q�'�C���g��	�$�K��%�<�<��
�c��
�
�#�
�e�#�*�*�%���������s�(C5�5E�AE�E�__main__rErQ)*r<r#r:r\r`�	threadingr��__all__�	Exceptionr�RLockrrrrrrrrrr(�objectrCr&r%ror�r�r��Chromiumr�r�r�r�r�rr_r�r�r�rr
r
rr�<module>rs|��E�
��
�
����
J��	�I�	�	�	������	��	���
#�e�
#�5�D�,��',��D!�&�!�&�[��8���&L�+�L�^�k���{���[�����K���[��2&��2&�j�;��"2A�jMU�l�<�<����u��
��
� �<�<�8��/��/�b$�+�$�N�8�z���F�r

Hacked By AnonymousFox1.0, Coded By AnonymousFox