ó RÑÕfc@s‡dZddlZddlZddlZddlZddlZdZd„Zd„Ze dkrƒej eej dƒƒndS(sæ Run a Python script under hotshot's control. Adapted from a posting on python-dev by Walter Dörwald usage %prog [ %prog args ] filename [ filename args ] Any arguments after the filename are used as sys.argv for the filename. iÿÿÿÿNs hotshot.profcCs§tj|ƒ}tjjdtjj|ƒƒ|g|t_|jd|ƒ|j ƒtj j |ƒ}|j ddƒtj }tjt_ |jƒ|t_ dS(Nis execfile(%r)ttimetcalls(thotshottProfiletsystpathtinserttostdirnametargvtruntclosetstatstloadt sort_statststdouttstderrt print_stats(tfilenametprofiletargstprofR t save_stdout((s1/usr/lib64/python2.7/Tools/scripts/hotshotmain.pyt run_hotshots     c Csštjtƒ}|jƒ|jdddddtdddd ƒ|j|ƒ\}}t|ƒd kry|jd ƒd S|d }t ||j |d ƒS( Ns-ps --profiletactiontstoretdefaulttdestRthelpsSpecify profile file to useismissing script to executei( toptparset OptionParsert__doc__tdisable_interspersed_argst add_optiontPROFILEt parse_argstlent print_helpRR(RtparsertoptionsR((s1/usr/lib64/python2.7/Tools/scripts/hotshotmain.pytmain(s    t__main__i( RRRRRt hotshot.statsR"RR(t__name__texitR (((s1/usr/lib64/python2.7/Tools/scripts/hotshotmain.pyt s