????

Your IP : 3.23.61.5


Current Path : /lib/python3.6/site-packages/glances/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/glances/__pycache__/__init__.cpython-36.pyc

3

Eo�c��@sldZddlZddlZddlZddlZdZdZdZyddlmZ	Wn&e
k
rfed�ejd�YnXdd	l
mZdd
lmZddlmZddlmZyejejd
�Wnejk
r�ed�YnXejd!ks�d"ejko�d#kn�red�ejd�d$Zedd�e	jd�D��Zeek�r:ed�ejd�e�rHddlZdd�Zdd�Zdd�Z dd �Z!dS)%zInit the Glances software.�Nz3.3.1z'Nicolas Hennion <nicolas@nicolargo.com>ZLGPLv3)�__version__z/psutil library not found. Glances cannot start.�)�PY3)�logger)�GlancesMain)�Counter�z8Warning: Unable to set locale. Expect encoding problems.����z3Glances requires at least Python 2.7 or 3.4 to run.�cCsg|]}t|��qS�)�int)�.0Znumrr�/usr/lib/python3.6/__init__.py�
<listcomp>5sr�.z7psutil 5.3.0 or higher is needed. Glances cannot start.cCs
t�dS)zCallback for CTRL-C.N)�end)�signal�framerrr�__signal_handler?srcCs>ytj�Wnttfk
r$YnXtjd�tjd�dS)z
Stop Glances.z%Glances stopped (key pressed: CTRL-C)rN)�moder�	NameError�KeyErrorr�info�sys�exitrrrrrDs
rcCs�|js|jrtj�t�}tj�r0ddlm}nVtj	�r\tj
�rNddlm}q�ddl
m}n*tj�rrddlm}ntj�r�ddlm}tjdj|j��|||d�atjd	j|j���|jr�tjd
j|j|j|jd��|j�rtdj|j|j|jd��tj|j�tj �}|j!�s,|j"�r6tj#�ntj$�|j�r�tj �}|j%|d
�}t&dd�|D��}tdj|d��tjd�xd|dd�D]}tj|��q�WnB|j�r�tj �}	|	j'd
�}
td�x|
dd�D]}t|��q�Wtj(�dS)zStart Glances.r)�GlancesStandalone)�GlancesClientBrowser)�
GlancesClient)�
GlancesServer)�GlancesWebServerz
Start {} mode)�config�argszGlances started in {} secondsz&Glances will be stopped in ~{} secondsr	z1Memory leak detection, please wait ~{} seconds...�filenamecSsg|]
}|j�qSr)Z	size_diff)r�srrrr�szstart.<locals>.<listcomp>z3Memory consumption: {0:.1f}KB (see log for details)i�zMemory consumption (top 5):Nr
z[ Trace malloc - Top 10 ]�
))Ztrace_malloc�memory_leak�tracemalloc�startr�coreZ
is_standaloneZglances.standalonerZ	is_clientZis_client_browserZglances.client_browserrZglances.clientr Z	is_serverZglances.serverr!Zis_webserverZglances.webserverr"rr�format�__name__r�debug�getZ
stop_afterZtime�printZserve_nZ
take_snapshotZstdout_issueZ
stdout_apidocZserve_issueZ
serve_foreverZ
compare_to�sumZ
statisticsr)r#r$Zstart_durationZGlancesModeZsnapshot_beginZsnapshot_endZ
snapshot_diffr(�statZsnapshotZ	top_statsrrrr*SsT"


r*cCs\tjtjt�tjdjt��tjdjtj�tj	�t
jt��t
�attj�tj�d�dS)zdMain entry point for Glances.

    Select the mode (standalone, client or server)
    Run it...
    zStart Glances {}z!{} {} ({}) and psutil {} detected)r#r$N)r�SIGINTrrrr,r�platformZpython_implementationZpython_versionr�
executable�psutil_versionrr+r*Z
get_configZget_argsrrrr�main�s
r7)r	r
)rr)rr)r
rr)"�__doc__Zlocaler4rrr�
__author__Z__license__Zpsutilr6�ImportErrorr0rZglances.compatrZglances.loggerrZglances.mainrZ
glances.timerr�	setlocale�LC_ALL�Error�version_infoZpsutil_min_version�tuple�splitZpsutil_version_infor)rrr*r7rrrr�<module>sD&


F