ó Ă°ŚQc@sËdZddlZddlZddlZd„ZeejƒddlmZddlm Z m Z ddl m Z ddl mZmZdefd „ƒYZejd „Zed krÇeƒndS( sj Implementation of C{AMP} worker commands, and main executable entry point for the workers. @since: 12.3 i˙˙˙˙NcCs-d|kr)|djtjƒtj(ndS(sĄ Override C{sys.path} with what the parent passed in B{TRIAL_PYTHONPATH}. @see: twisted.trial._dist.disttrial.DistTrialRunner.launchWorkerProcesses tTRIAL_PYTHONPATHN(tsplittostpathseptsystpath(tenviron((sC/usr/lib/python2.7/dist-packages/twisted/trial/_dist/workertrial.pyt _setupPaths (t FileWrapper(tstartLoggingWithObserverttextFromEventDict(t WorkerOptions(t_WORKER_AMP_STDINt_WORKER_AMP_STDOUTtWorkerLogObservercBs eZdZd„Zd„ZRS(sF A log observer that forward its output to a C{AMP} protocol. cCs ||_dS(sg @param protocol: a connected C{AMP} protocol instance. @type protocol: C{AMP} N(tprotocol(tselfR((sC/usr/lib/python2.7/dist-packages/twisted/trial/_dist/workertrial.pyt__init__+scCsIddlm}t|ƒ}|dkr,dS|jj|jd|ƒdS(s' Produce a log output. i˙˙˙˙(tmanagercommandsNtout(ttwisted.trial._distRR tNoneRt callRemotet TestWrite(Rt eventDictRttext((sC/usr/lib/python2.7/dist-packages/twisted/trial/_dist/workertrial.pytemit3s   (t__name__t __module__t__doc__RR(((sC/usr/lib/python2.7/dist-packages/twisted/trial/_dist/workertrial.pyR&s c Csntƒ}|jƒddlm}||dƒ}|tƒ}|tdƒ}|jt|ƒƒt|ƒ}t |j t ƒxt ry|j dƒ}Wn<tk r×}|jdtjkrŃtjƒq€q؂nX|dkrčPq€|j|ƒ|jƒtjjƒtjjƒq€W|jrjtjd ƒ|jjƒ} | jdt d t d |jƒjƒnd S( s­ Main function to be run if __name__ == "__main__". @param _fdopen: If specified, the function to use in place of C{os.fdopen}. @param _fdopen: C{callable} i˙˙˙˙(tWorkerProtocolsforce-gctwiitt show_missingtsummarytcoverdirN(R t parseOptionsttwisted.trial._dist.workerRR R tmakeConnectionRRR RtFalsetTruetreadtIOErrortargsterrnotEINTRRt exc_cleart dataReceivedtflushtstdouttstderrttracertsettraceRtresultst write_resultsR#R( t_fdopentconfigRtworkerProtocolt protocolInt protocolOuttobservertrteR5((sC/usr/lib/python2.7/dist-packages/twisted/trial/_dist/workertrial.pytmain?s8            t__main__(RRRR,RRttwisted.internet.protocolRttwisted.python.logR R ttwisted.trial._dist.optionsR RR R tobjectRtfdopenR?R(((sC/usr/lib/python2.7/dist-packages/twisted/trial/_dist/workertrial.pyt s    -