AnonSec Shell
Server IP : 5.101.180.230  /  Your IP : 216.73.217.19   [ Reverse IP ]
Web Server : Apache/2.4.62 (Debian)
System : Linux s4261ad19.fastvps-server.com 6.1.0-30-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.124-1 (2025-01-12) x86_64
User : mrnews_ru_usr ( 1030)
PHP Version : 8.2.26
Disable Function : NONE
Domains : 1 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/softwareproperties/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/softwareproperties/__pycache__/MirrorTest.cpython-311.pyc
�

��c��$�ddlZ	ddlmZmZn#e$rddlmZmZYnwxYwddlZddlZddlZddlZddl	Z
ddlZ
	ddlm
Z
n#e$r	ddlm
Z
YnwxYwddlZGd�dej��Zedk�re
j���Ze�e
j�����ejd��Ze������Zej��Ze���dej j!�d	ej j"dj!�d
e�d�Z#ee$ej j%�&����e#ej��e��Z'e'�(��dSdS)�N)�Empty�Queue)�urlopenc�n�eZdZdZGd�dej��Zdd�Zd�Zdd	�Z	d
�Z
dd�Z		dd
�Zd�Z
dS)�
MirrorTestz@Determines the best mirrors by perfoming ping and download test.c� �eZdZdZdd�Zd�ZdS)�MirrorTest.PingWorkerz�Use the command line command ping to determine the server's
           response time. Using multiple threads allows to run several
           test simultaneously.�r��rrc���||_||_||_||_||_||_t
jd��|_tj
�|��dS)Nz^rtt .* = [\.\d]+/([\.\d]+)/.*)�borders�mod�parent�id�jobs�results�re�compile�match_result�	threading�Thread�__init__)�selfrrrrrrs       �?/usr/lib/python3/dist-packages/softwareproperties/MirrorTest.pyrzMirrorTest.PingWorker.__init__s\��"�D�L��D�H� �D�K��D�G��D�I�"�D�L� "�
�+L� M� M�D����%�%�d�+�+�+�+�+�c�(�d}|j����s�|jj����r�	|j�d��}|j}|j�d|z��tj	ddddd|gtj
tjd�	��j}	|�
��}|sntj|j|��}�2n0#t"$rYdS|j�d
|z��YnxYwt$j���t$xjdz
c_|j�t$jt$j|j|j��|r0|j�t9|d��||g��t$j���|j���s%|jj������dSdSdSdS)
NFz
Pinging %s...�pingz-qz-c 2z-W 1z-i 0.5T)�stdout�stderr�universal_newlineszSkipping %srr)r�emptyr�running�isSet�get�hostname�
report_action�
subprocess�Popen�PIPE�STDOUTr�readliner�findallrrr�completed_lock�acquire�	completed�report_progress�todorrr�append�float�release)r�result�mirror�host�commando�lines      r�runzMirrorTest.PingWorker.run#s+���F��i�o�o�'�'�
4�D�K�,?�,E�,E�,G�,G�
4�D�!�Y�]�]�5�1�1�F�!�?�D��K�-�-�o��.D�E�E�E�)�/���v�v�x�Y]�0^�7A��7A�7H�CG� I� I� I�JP��E�'�0�0�2�2��#�"�!�!#��D�,=�t�!D�!D��	E�"�������F�F�D��K�-�-�m�d�.B�C�C�C�C�C�����)�1�1�3�3�3��$�$��)�$�$���+�+�J�,@�,6�O�,0�L�,0�H�6�6�6��J��L�'�'��v�a�y�)9�)9�4��(H�I�I�I��)�1�1�3�3�3�9�i�o�o�'�'�
4�D�K�,?�,E�,E�,G�,G�
4�
4�
4�
4�
4�
4�
4�
4�
4s�B(C&�&
D�3DN)r
r)�__name__�
__module__�__qualname__�__doc__rr;�rr�
PingWorkerr	sA������	#�	#�	,�	,�	,�	,�	4�	4�	4�	4�	4rrANc�p�tj�|��d|_d|_||_d|_||_g|_dt_
tj��t_t|��t_||_|stj��|_dS||_dS)N�)rrgr)rrr�action�progress�event�best�	test_file�threadsrr0�Lockr.�lenr2�mirrors�Eventr#)rrLrHrFr#s     rrzMirrorTest.__init__Cs�����!�!�$�'�'�'����#��
���
���	�"������ �
��$-�N�$4�$4�
�!��g�,�,�
������	#�$�?�,�,�D�L�L�L�"�D�L�L�Lrc�X�||_|jr|j���dSdS�N)rDrF�set)r�texts  rr'zMirrorTest.report_actionTs5������:�	��J�N�N������	�	r�r�drc��||dz||dz|d|d|dz
|z|zzf|_|jr|j���dSdS)zTSubclasses should override this method to receive
           progress status updatesrrN)rErFrP)r�current�maxrrs     rr1zMirrorTest.report_progressYsv��!�3�q�6�)��s�1�v�� ���w�q�z�G�A�J�'>�#�&E��&O�O�Q��
��:�	��J�N�N������	�	rc
�T�|�ddd���}t|j��}|dkrr|�dd|jt	jd|dz
��g��|�dd|jt	jd|dz
��g��|�d�|D��d	tjtjf�
��}|D]\}}td|j
�d|����� |sdS|ddj
}td
|z��|S)N�)r��?)r�)rVrr�rrc��g|]
}|d��S)r[r@)�.0�rs  r�
<listcomp>z,MirrorTest.run_full_test.<locals>.<listcomp>js��)E�)E�)E�1�!�A�$�)E�)E�)Er�rYr)rrzmirror: z	 - time: zand the winner is: %s)�
run_ping_testrKrLr3�random�randint�run_download_testrr2�printr&)r�results_ping�sizer�t�h�winners       r�
run_full_testzMirrorTest.run_full_testbsB���)�)�a��u�)�M�M���4�<� � ���!�8�8�����A�t�|�F�N�1�d�1�f�4M�4M�'N� O�P�P�P�����A�t�|�F�N�1�d�1�f�4M�4M�'N� O�P�P�P��(�(�)E�)E��)E�)E�)E�19�.8�o�.8�o�.?�)�@�@���	=�	=�F�Q���E�Q�Z�Z�Z���;�<�<�<�<��	��4��Q�Z��]�+�F��)�F�2�3�3�3��Mrr
c	��|dkr|j}t��}|D]}|�|���g}td��D]O}t�||||||��}	|j�|	��|	����P|jD]}	|	�	���|�
��|d|�S)z�Performs ping tests of the given mirrors and returns the
           best results (specified by max).
           Mod and borders could be used to tweak the reported result if
           the download test is only a part of a whole series of tests.N�r)rLr�put�rangerrArIr3�start�join�sort)
rrLrVrrr�mr�irhs
          rrazMirrorTest.run_ping_testws���
�d�?�?��l�G��w�w���	�	�A��H�H�Q�K�K�K�K����r���	�	�A��%�%�d�G�Q��g�s�K�K�A��L����"�"�"�
�G�G�I�I�I�I���	�	�A�
�F�F�H�H�H�H��������q��u�~�rc�n���fd�}|dkr�j}g}|D]�}�j���snd||��}|dkr|�||g����|�|��dzt
|��d|����|���|d|�S)z�Performs download tests of the given mirrors and returns the
           best results (specified by max).
           Mod and borders could be used to tweak the reported result if
           the download test is only a part of a whole series of tests.c�(��|���d�d�j��}��d|z��tj��}	t	|d����d��tj��|z
S#YdSxYw)Nr�/zDownloading %s...r[)�timeouti�)�
get_repo_urlsrHr'�timer�read)r7�urlrprs   �r�test_download_speedz9MirrorTest.run_download_test.<locals>.test_download_speed�s����#�1�1�3�3�A�6�6�6�!�^�^�-�C����2�S�8�9�9�9��I�K�K�E�
���Q�'�'�'�,�,�V�4�4�4��y�{�{�U�*�*��
��q�q���s�9B�BNrrr`)rLr#r$r3r1�indexrKrr)	rrLrVrrr}rrs�
download_times	`        rrdzMirrorTest.run_download_test�s����		�		�		�		�		��d�?�?��l�G����	T�	T�A��<�%�%�'�'�
���/�/��2�2�M��q� � ����
�q�1�2�2�2�� � ����q�!1�!1�A�!5�s�7�|�|�X�s�S�S�S�S��������q��u�~�rc�j�|���|_|j���dS)z/Complete test exercise, set self.best when doneN)rkrGr#�clear)rs rr;zMirrorTest.run�s/���&�&�(�(��	���������rrO)rRr)NNr
r)r<r=r>r?rrrArr'r1rkrardr;r@rrrrs�������J�J�+4�+4�+4�+4�+4�Y�%�+4�+4�+4�Z#�#�#�#�"���
�������*����.AF�#�����<����rr�__main__zdpkg --print-architecturezdists/rwz/binary-z/Packages.gz))r�queuerr�ImportErrorrzrr(�os�aptsources.distro�
aptsources�aptsources.sourceslist�urllib.requestr�urllib2rbrrr<�distro�
get_distro�get_sources�sourceslist�SourcesList�popen�piper{�strip�archrMr#rP�source_template�name�
componentsrH�list�
mirror_set�values�apprkr@rr�<module>r�sZ������#�"�"�"�"�"�"�"�"�"���#�#�#�"�"�"�"�"�"�"�"�"�"�#��������	�	�	�	�����	�	�	�	��������� �&�&�&�&�&�&�&��� � � ��������� ����
�
�
�
�[�[�[�[�[��!�[�[�[�z�z���
�
�
)�
)�
+�
+�F�
���z�-�9�9�;�;�<�<�<��2�8�/�0�0�D��9�9�;�;�����D��i�o���G��K�K�M�M�M�M��'�,�,�,��'�2�1�5�:�:�:�����I��*�T�T�&�0�;�B�B�D�D�E�E���	�� 1� 1�7�<�<�C����������s��
��A�A�A

Anon7 - 2022
AnonSec Team