Ñò ý÷òGc@sÁdZy ddkZddklZWnej od \ZZnXddkZddkZddkZddkZddk l Z ddk l Z ei dƒZde fd„ƒYZdS( s~Use the profile plugin with --with-profile or NOSE_WITH_PROFILE to enable profiling using the hotshot profiler. Profiler output can be controlled with the --profile-sort and --profile-restrict, and the profiler output file may be changed with --profile-stats-file. See the hotshot documentation in the standard library documentation for more details on the various output options. iÿÿÿÿN(tstats(tPlugin(ttolists nose.pluginstProfilecBsteZdZd ZeZeid„Z d„Z e e ƒZ d„Z d„Z d„Zd„Zd„Zd„ZRS( sC Use this plugin to run tests using the hotshot profiler. c Cs¶|iƒpdSti|||ƒ|idddddd|iddƒd d ƒ|id dddd d|id ƒd dƒ|idddddd|idƒd dƒdS(Ns--profile-sorttactiontstoretdestt profile_sorttdefaulttNOSE_PROFILE_SORTt cumulativethelps"Set sort order for profiler outputs--profile-stats-filetprofile_stats_filetNOSE_PROFILE_STATS_FILEs;Profiler stats file; default is a new temp file on each runs--profile-restricttappendtprofile_restricttNOSE_PROFILE_RESTRICTs?Restrict profiler output. See help for pstats.Stats for details(t availableRtoptionst add_optiontget(tselftparsertenv((s5/usr/lib/python2.6/site-packages/nose/plugins/prof.pyRs cCs tdj S(N(thotshottNone(tcls((s5/usr/lib/python2.6/site-packages/nose/plugins/prof.pyR0scCs5|iƒpdS|iƒti|iƒ|_dS(N(Rt _create_pfileRRtpfiletprof(R((s5/usr/lib/python2.6/site-packages/nose/plugins/prof.pytbegin4s  cCs—|iƒpt|_dSti|||ƒ||_|io|i|_t|_nd|_t |_d|_ |i |_ t|iƒ|_dS(N(RtFalsetenabledRt configuretconfR Rtclean_stats_fileRtTruetfilenoRtsortRRtrestrict(RRR"((s5/usr/lib/python2.6/site-packages/nose/plugins/prof.pyR!:s          cs?ˆiƒpdStid|ƒˆi|‡fd†}|S(Nspreparing test %scsˆiƒ|i||ƒdS(N(Rtruncall(tresultRttest(R(s5/usr/lib/python2.6/site-packages/nose/plugins/prof.pytrun_and_profileNs (RtlogtdebugR(RR*R+((Rs5/usr/lib/python2.6/site-packages/nose/plugins/prof.pyt prepareTestJs  cCsÞtidƒ|iiƒti|iƒ}|i|iƒt tdƒ}|o|i }|t_ nt i }|t _ z?|i o'tid|i ƒ|i|i Œn |iƒWd|o |t_ n |t _ XdS(Nsprinting profiler reporttstreams"setting profiler restriction to %s(R,R-RtcloseRtloadRt sort_statsR&thasattrR/tsyststdoutR't print_stats(RR/t prof_statst compat_25ttmp((s5/usr/lib/python2.6/site-packages/nose/plugins/prof.pytreportSs$        c Cs­|iƒpdSy|iiƒWntj onX|iof|io.yti|iƒWq{tj oq{Xnyti|i ƒWq©tj oq©XndS(N( RRR0tAttributeErrorR#R%tostOSErrortunlinkRR(RR)((s5/usr/lib/python2.6/site-packages/nose/plugins/prof.pytfinalizeos"     cCs3|ip%tiƒ\|_|_t|_ndS(N(RttempfiletmkstempR%R$R#(R((s5/usr/lib/python2.6/site-packages/nose/plugins/prof.pyR…s N(t__name__t __module__t__doc__RRRR#R<tenvironRRt classmethodRR!R.R:R?R(((s5/usr/lib/python2.6/site-packages/nose/plugins/prof.pyRs      (NN(RDRRt ImportErrorRtloggingR<R4R@tnose.plugins.baseRt nose.utilRt getLoggerR,R(((s5/usr/lib/python2.6/site-packages/nose/plugins/prof.pyts