ok

Mini Shell

Direktori : /proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/clcommon/
Upload File :
Current File : //proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/clcommon/clfunc.pyc

�
b=0Yc@s�ddlZddlZddlZddlZddlZdZd�Zidd6dd6dd6dd	6Zd
�Zdej	d�Z
dej	d
�Zd�Zd�Z
dS(i����Ns/proc/lve/listcCs�y�ttd�}|j�}yt|dd�dg}Wn!tk
r_ddtg}nX|ddkrddg}nWn!tk
r�ddtg}nX|S(NtritOKs/clcommon: get_lve_version: Can`t get data from is+clcommon: get_lve_version: Can`t open file (topentLVE_FILEt	readlinestintt
IndexErrortNonetIOError(tftlinestLVE_VERSIONtLVE_VERISON((s3/usr/lib/python2.7/site-packages/clcommon/clfunc.pytget_lve_versions

itKitMtGtTcCs�t|�}tjd�}tjd�}tjdtj�}|j|�}|j|�}|j|�}|dks�|dks�|dkr�|SdS(sb check that val is a valid CPU limit (0-100 int or speed (% or MHZ\GHZ))
   return val if ok a
   s
\d{1,2}0?$s\d+(?:\.\d+)?%$s\d+(?:\.\d+)?(mhz|ghz)+$N(tstrtretcompilet
IGNORECASEtmatchR(tvaltdatat
regexp_intt
regexp_speedpt
regexp_speedftp1tp2tp3((s3/usr/lib/python2.7/site-packages/clcommon/clfunc.pytvalidate_cpu s$icCsIyt|�}Wntk
r$dSX||ko<|knrE|SdS(sN
    Check that val - is a string number 
    
    return val as a string
    N(Rt
ValueErrorR(Rtmin_valtmax_valtdig_val((s3/usr/lib/python2.7/site-packages/clcommon/clfunc.pytvalidate_int0s
cCs�yu|d}|j�r,d}||}ntt|d �t|j�d�}||kok|knrt|SWntttfk
r�nXdS(Ni����Ri(	tisdigitRtfloattBYTES_CONVERSION_TABLEtupperRR tKeyErrorR(RR!R"tsuffixtresult((s3/usr/lib/python2.7/site-packages/clcommon/clfunc.pytmemory_to_page>s

(cCst|dkrt|d�dS|dkrOttt|�ddd��dSttt|�dd	d��dS(
NiiRiiiRRi(RtroundR&(tpages((s3/usr/lib/python2.7/site-packages/clcommon/clfunc.pytpage_to_memoryKs
%cCs�tjdd|d|gdtj�}|j�djd�}xr|D]j}|j�j�}y2|dj|�tjt	|d�t
j�WqGtt
tfk
r�qGqGXqGWdS(Ns/bin/pss-Us-utstdoutis
i����(t
subprocesstPopentPIPEtcommunicatetsplittrstriptindextostkillRtsignaltSIGHUPRR tOSError(titemtusernametpsR
trowtparts((s3/usr/lib/python2.7/site-packages/clcommon/clfunc.pytreload_processesRs'
!iii@(tsysR1R8R:RRR
R'RtmaxintR$R,R/RB(((s3/usr/lib/python2.7/site-packages/clcommon/clfunc.pyt<module>s<	
	
	

Zerion Mini Shell 1.0