-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/mercurial/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/mercurial/worker.pyc

ó
Ì\,Tc@s×ddlmZddlZddlZddlZddlZddlZddlZd„Zd„Z	ej
dkr‚dZndZd„Zd	„Z
d
„Zd„Zej
dkrÊeZeZnd
„ZdS(iÿÿÿÿ(t_NcCsˆy)ttjdƒƒ}|dkr(|SWnttfk
rBnXy'ttjdƒ}|dkri|SWnttfk
rƒnXdS(s-try to count the number of CPUs on the systemtSC_NPROCESSORS_ONLNitNUMBER_OF_PROCESSORSi(tinttostsysconftAttributeErrort
ValueErrortenvirontKeyError(tn((s4/usr/lib/python2.7/dist-packages/mercurial/worker.pyt	countcpusscCs}|jddƒ}|rdy t|ƒ}|dkr7|SWqdtk
r`tjtdƒƒ‚qdXntttƒdƒdƒS(Ntworkertnumcpusis!number of cpus must be an integerii (	tconfigRRtutiltAbortRtmintmaxR(tuitsR
((s4/usr/lib/python2.7/dist-packages/mercurial/worker.pyt_numworkers!s
tposixg{®Gáz„?gꌠ9Y>)FcCs6||}t|ƒ}|t|||}|dkS(setry to determine whether the benefit of multiple processes can
    outweigh the cost of starting themg333333Ã?(Rt_startupcost(Rt	costperoptnopstlineartworkerstbenefit((s4/usr/lib/python2.7/dist-packages/mercurial/worker.pyt
worthwhile1s
cCs<t||t|ƒƒr+t||||ƒS|||fŒS(sFrun a function, possibly in parallel in multiple worker
    processes.

    returns a progress iterator

    costperarg - cost of a single task

    func - function to run

    staticargs - arguments to pass to every invocation of the function

    args - arguments to split into chunks, to pass to individual
    workers
    (Rtlent_platformworker(Rt
costperargtfunct
staticargstargs((s4/usr/lib/python2.7/dist-packages/mercurial/worker.pyR9sc#stjƒ\}}t|ƒ}tjtjƒ‰tjtjtjƒgdg‰‰xÏt||ƒD]¾}tjƒ}|dkrtjtjˆƒy\tj	|ƒx;|||fŒD]&\}	}
tj
|d|	|
fƒq»WtjdƒWqtk
rtjdƒqXnˆj
|ƒqfWˆjƒtj	|ƒtj|ddƒ}‡fd†‰‡‡‡fd†}tjd|ƒ‰ˆjƒ‡‡‡fd†}
yDx=|D]5}|jd	d
ƒ}t|dƒ|d
d fVq³WWnˆƒ|
ƒ‚nX|
ƒdS(Nis%d %s
iÿtrbcsZxSˆD]K}ytj|tjƒWqtk
rQ}|jtjkrR‚qRqXqWdS(N(RtkilltsignaltSIGTERMtOSErrorterrnotESRCH(tpterr(tpids(s4/usr/lib/python2.7/dist-packages/mercurial/worker.pytkillworkerscs
csPxIˆD]A}ttjƒdƒ}|rˆdr|ˆd<ˆƒqqWdS(Nii(t_exitstatusRtwait(Rtst(R.R-tproblem(s4/usr/lib/python2.7/dist-packages/mercurial/worker.pytwaitforworkersks


ttargetcsgtjtjˆƒˆjƒˆd}|rc|dkrStjtjƒ|ƒntj|ƒndS(Ni(R&tSIGINTtjoinRR%tgetpidtsystexit(tstatus(t
oldhandlerR2tt(s4/usr/lib/python2.7/dist-packages/mercurial/worker.pytcleanupss

t iiÿÿÿÿ(RtpipeRR&t	getsignalR5tSIG_IGNt	partitiontforktclosetwritet_exittKeyboardInterrupttappendtreversetfdopent	threadingtThreadtstarttsplitR(RR!R"R#trfdtwfdRtpargstpidtititemtfpR3R=tlinetl((R.R;R-R2R<s4/usr/lib/python2.7/dist-packages/mercurial/worker.pyt_posixworkerLsD
 




%cCs=tj|ƒrtj|ƒStj|ƒr9tj|ƒSdS(sˆconvert a posix exit status into the same form returned by
    os.spawnv

    returns None if the process was stopped instead of exitingN(Rt	WIFEXITEDtWEXITSTATUStWIFSIGNALEDtWTERMSIG(tcode((s4/usr/lib/python2.7/dist-packages/mercurial/worker.pyt_posixexitstatus…s
tntccs{t|ƒ}||||}}d}xMt|ƒD]?}|}||}|rg|d7}|d8}n|||!Vq4WdS(s,partition a list into N slices of equal sizeiiN(Rtxrange(tlsttnslicesR
tchunktsloptendRSRM((s4/usr/lib/python2.7/dist-packages/mercurial/worker.pyRB“s


(ti18nRR)RR&R8RKRRRtnameRRRRXR^RR/RB(((s4/usr/lib/python2.7/dist-packages/mercurial/worker.pyt<module>s<						9	
	

Copyright © 2017 || Recoded By Mr.Bumblebee