/usr/lib/python3/dist-packages/softwareproperties/__pycache__
Edit: /usr/lib/python3/dist-packages/softwareproperties/__pycache__/MirrorTest.cpython-310.pyc (6431B)
o
UÀ7e ã @ sL d dl Z z
d dlmZmZ W n ey d dlmZmZ Y nw d dlZd dlZd dlZd dlZd dl Z
d dlZ
zd dlm
Z
W n eyO d dlm
Z
Y nw d dlZG dd„ de jƒZedkr¤e
j ¡ Ze e
j ¡ ¡ e d¡Ze ¡ ¡ Ze ¡ Ze ¡ dej j!ej j"d j!ef Z#ee$ej j% &¡ ƒe#e ¡ eƒZ'e' (¡ dS dS ) é N)ÚEmptyÚQueue)Úurlopenc @ sf e Zd ZdZG dd„ dejƒZddd„Zdd„ Zddd„Z d
d„ Z
ddd„Z
ddd„Zdd„ Z
dS )Ú
MirrorTestz@Determines the best mirrors by perfoming ping and download test.c @ s" e Zd ZdZd dd„Zdd„ ZdS )
zMirrorTest.PingWorkerz¢Use the command line command ping to determine the server's
response time. Using multiple threads allows to run several
test simultaneously.©r é ©r r c C s@ || _ || _|| _|| _|| _|| _t d¡| _t j
| ¡ d S )Nz^rtt .* = [\.\d]+/([\.\d]+)/.*)ÚbordersÚmodÚparentÚidÚjobsÚresultsÚreÚcompileÚmatch_resultÚ threadingÚThreadÚ__init__)Úselfr
r r r r r
© r ú?/usr/lib/python3/dist-packages/softwareproperties/MirrorTest.pyr s zMirrorTest.PingWorker.__init__c C s0 d }| j ¡ s’| jj ¡ r”z5| j d¡}|j}| j d| ¡ tj ddddd|gtj
tjdd j} |
¡ }|s9nt | j|¡}q2W n tyL Y d S | j d
| ¡ Y tj ¡ t jd7 _| j tjtj| j| j¡ |r€| j t|d ƒ||g¡ tj ¡ | j ¡ s–| jj ¡ s
d S d S d S d S )
NFz
Pinging %s...Úpingz-qz-c 2z-W 1z-i 0.5T)ÚstdoutÚstderrÚuniversal_newlineszSkipping %sr r )r
Úemptyr ÚrunningÚisSetÚgetÚhostnameÚ
report_actionÚ
subprocessÚPopenÚPIPEÚSTDOUTr Úreadliner Úfindallr r r Úcompleted_lockÚacquireÚ completedÚreport_progressÚtodor r
r ÚappendÚfloatÚrelease)r ÚresultÚmirrorÚhostÚcommandoÚliner r r Úrun# sF ýýü
ý
&äzMirrorTest.PingWorker.runN)r r )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r5 r r r r Ú
PingWorker s
r: Nc C sl t j | ¡ d| _d| _|| _d | _|| _g | _dt _
t ¡ t _t
|ƒt _|| _|s1t ¡ | _d S || _d S )NÚ )r r g r )r r r ÚactionÚprogressÚeventÚbestÚ test_fileÚthreadsr r* ÚLockr( Úlenr, ÚmirrorsÚEventr )r rD r@ r> r r r r r C s
zMirrorTest.__init__c C s || _ | jr
| j ¡ d S d S ©N)r<