Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
site-packages
/
sos
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/site-packages/sos/helpers.pyc
mò {ÃWc�����������@���sÍ���d��Z��d�k�Z�d�k�Z�d�k�Z�d�k�Z�d�k�Z�d�k�Z�d�k�l�Z�d�k�l �Z �d�k �l�Z�l�Z�l �Z �d�„��Z�d�„��Z�d�„��Z�d�„��Z�d �„��Z�d �„��Z�d�„��Z�e�i�i�e�i�i�d�„�Z�d�S( ���s0��� helper functions used by sosreport and plugins N(���s���time(���s���mkdtemp(���s���Popens���PIPEs���STDOUTc���������C���sI���y"�t��|��t�ƒ��t�ƒ��|�g�ƒ�}�Wn�t�j �o�d�Sn�Xt�|�|�ƒ�S(���s9��� Import a plugin to extend capabilities of sosreport N( ���t ���__import__t ���pluginnamet���globalst���localst���namet���plugint���ImportErrort���Nonet���getattr(���R���R���R���(����(����t/���/usr/lib/python2.4/site-packages/sos/helpers.pyt���importPlugin!���s�����" c���������C���sL���y:�t��i�i�|��ƒ�p�t��i�|��ƒ�n�t�d�d�|��ƒ�}�Wn�d�Sn�X|�S(���sY���Find a temp directory to form the root for our gathered information and reports. t����t���sos_N(���t���ost���patht���isdirt���tmpdirt���mkdirt���mkdtempt���workingBaseR���(���R���R���(����(����R ���t ���sosFindTmpDir+���s�����c���������C���sm���t��i��|��t��i�ƒ�}�y!�t��i��|��t��i�|�t�i�Bƒ�Wn0�t�j �o$�t��i��|��t��i�|�t�i�Bƒ�n�Xd�S(���sE��� Make the file descriptor non-blocking. This prevents deadlocks. N( ���t���fcntlt���afdt���F_GETFLt���flt���F_SETFLR ���t���O_NDELAYt���AttributeErrort���FNDELAY(���R���R���(����(����R ���t���makeNonBlocking8���s�����!c���������C���sŽ���t��ƒ��}�t�i�}�d�|�d�<t�|��d�t�d�t�d�t �d�d�d�|�ƒ}�|�i�ƒ��\�}�}�|�d�d �j�o�|�d� }�n�|�i�|�t��ƒ��|�f�S(���sD��� Execute a command and gather stdin, stdout, and return status. t���Ct���LC_ALLt���shellt���stdoutt���stderrt���bufsizeiÿÿÿÿt���envs��� N(���t���timet���stimeR ���t���environt���cmd_envt���Popent���commandt���Truet���PIPEt���STDOUTt���pt���communicateR!���R"���t ���returncode(���R*���R!���R(���R.���R&���R"���(����(����R ���t���sosGetCommandOutputB���s����� �c���������C���s&���|��p �d�GHn�d�GHt�i�i�ƒ��d�S(���se��� Complete a status line that has been output to the console, providing pass/fail indication. s��� [ OK ]s��� [ FAILED ]N(���t���statt���sysR!���t���flush(���R2���(����(����R ���t ���sosStatusS���s����� c���������C���s8���|��d�}�x'�|��d�D]�}�|�|�j�o�t�Sq�q�Wt�S(���s=��� return True if all the elements are equal, otherwise False. i����i���N(���t���elementst ���first_elementt ���other_elementt���FalseR+���(���R6���R7���R8���(����(����R ���t���allEqual_���s����� � c����������G���s‡���|��p�g��g��f�Sn�g��}�x:�t�i�|��Œ��D])�}�t�|�ƒ�p�Pn�|�i�|�d�ƒ�q+�W|�g��}�|��D]�}�|�|�t �|�ƒ�qf�~�f�S(���sŠ��� return a list of common elements at the start of all sequences, then a list of lists that are the unique tails of each sequence. i����N( ���t ���sequencest���commont ���itertoolst���izipR6���R:���t���appendt���_[1]t���sequencet���len(���R;���R6���RA���R@���R<���(����(����R ���t���commonPrefixh���s������ c���������C���sx���y1�t��|��i�|�ƒ�|�i�|�ƒ�ƒ�\�}�\�}�}�Wn�t�j �o�|�Sn�X|�p�|�Sn�|�i �|�g�t�|�ƒ�|�ƒ�S(���sÅ��� return a relative path from path1 equivalent to path path2. In particular: the empty string, if path1 == path2; path2, if path1 and path2 have no common prefix. N(���RC���t���path1t���splitt���sept���path2R<���t���u1t���u2R���t���joint���pardirRB���(���RD���RG���RF���RK���RH���RI���R<���(����(����R ���t ���sosRelPathy���s�����1 (���t���__doc__R ���R���t���selectR=���R3���t���commandsR%���t���tempfileR���t ���subprocessR)���R,���R-���R ���R���R���R1���R5���R:���RC���R���RF���RK���RL���(���R���R,���RO���RC���R���R-���R ���R)���R5���R3���R=���R���R%���RL���R1���R:���R ���RN���R���(����(����R ���t���?���s���6