????

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__/globals.cpython-36.pyc

3

Eo�c��@sFdZddlZddlZddlZddlZddlZddlmZejjd�dkZ	ejj
d�Zejj
d�Zejj
d�Z
ejj
d	�Zdej�j�ko�d
ej�dj�kZejjejje��Zejjejjed��Zejjejjed
��Zejjejjed��Zejdd�Zejjde�ejjde�ejjde�dd�Zdd�Zdd�Z dS)z-Common objects shared by all Glances modules.�N)�
itemgetterZbsd��linux�darwin�sunos�winZ	microsoft�ZampsZpluginsZexportscCsTytj|�Wn@tk
rN}z$|jtjkr<tjj|�s>�n�WYdd}~XnXdS)z.A safe function for creating a directory tree.N)�os�makedirs�OSError�errnoZEEXIST�path�isdir)r
�err�r�/usr/lib/python3.6/globals.py�
safe_makedirs&srcCs.y
tj|�Stk
r(tj|dd�SXdS)zyReturn the object data in a JSON format.

    Manage the issue #815 for Windows OS with UnicodeDecodeError catching.
    F)Zensure_asciiN)�ujson�dumps�UnicodeDecodeError)�datarrr�
json_dumps2s
rcCsbt|t�r(yt|||i�SdSn6t|t�rZyt|ttt|�|��i�SdSndSdS)N)�
isinstance�dictr�list�mapr)r�itemrrr�json_dumps_dictlist=s

r���)!�__doc__rr	�sys�platformr�operatorr�findZBSD�
startswithZLINUXZMACOSZSUNOSZWINDOWS�system�lower�unameZWSLr
�realpath�dirname�__file__Z	work_path�joinZ	amps_pathZplugins_pathZexports_pathZsys_path�insertrrrrrrr�<module>
s.$