Ϫfz dZddlZddlZddlZddlmZddlmZmZddl m Z m Z ddl m Z GddZejfd Zed k(reyy) zj Implementation of C{AMP} worker commands, and main executable entry point for the workers. @since: 12.3 N) FileWrapper)startLoggingWithObservertextFromEventDict)_WORKER_AMP_STDIN_WORKER_AMP_STDOUT) WorkerOptionsceZdZdZdZdZy)WorkerLogObserverzF A log observer that forward its output to a C{AMP} protocol. c||_y)zg @param protocol: a connected C{AMP} protocol instance. @type protocol: C{AMP} N)protocol)selfr s A/usr/lib/python3/dist-packages/twisted/trial/_dist/workertrial.py__init__zWorkerLogObserver.__init__s ! czddlm}t|}|y|jj |j |y)z' Produce a log output. r)managercommandsN)out)twisted.trial._distrrr callRemote TestWrite)r eventDictrtexts remitzWorkerLogObserver.emit#s6 8 + <    !:!: ErN)__name__ __module__ __qualname____doc__rrrrr r s! Frr c2t}|jddlm}||d}|td}|t d}|j t|t|}t|jd |jd}|d k(rn^|j!||j#t$j&j#t$j(j#v|j*r\t%j,d |j*j/} | j1dd|j3j4 y y #t$r,}|jdtjk(rYd }~d }~wwxYw) z Main function to be run if __name__ == "__main__". @param _fdopen: If specified, the function to use in place of C{os.fdopen}. @type _fdopen: C{callable} r)WorkerProtocolzforce-gcrbwbFTNr) show_missingsummarycoverdir)r parseOptionstwisted.trial._dist.workerr rrmakeConnectionrr rrreadOSErrorargserrnoEINTR dataReceivedflushsysstdoutstderrtracersettraceresults write_resultsr&path) _fdopenconfigr workerProtocol protocolIn protocolOutobserverrer6s rmainrA/sN_F 9#F:$67N*D1J,d3K!!+k":; 0HX]]E2  "A 8   ' ' *     JJ    JJ     }} T--'')uv7H7M7M   vvayEKK'  sE!! F* FFF__main__)rr-osr1twisted.internet.protocolrtwisted.python.logrrrrrtwisted.trial._dist.optionsrr fdopenrArrrrrHsP  1JE5FF0* Z zFr