File: //usr/lib64/python2.7/Tools/scripts/hotshotmain.pyo
�
�fc           @   s�   d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z d Z d �  Z d �  Z e	 d k r� e j
 e e j d � � n  d S(   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.profc         C   s�   t  j | � } t j j d t j j |  � � |  g | t _ | j d |  � | j	 �  t  j
 j | � } | j d d � t j
 } t j t _
 | j �  | t _
 d S(   Ni    s   execfile(%r)t   timet   calls(   t   hotshott   Profilet   syst   patht   insertt   ost   dirnamet   argvt   runt   closet   statst   loadt
   sort_statst   stdoutt   stderrt   print_stats(   t   filenamet   profilet   argst   profR   t   save_stdout(    (    s1   /usr/lib64/python2.7/Tools/scripts/hotshotmain.pyt   run_hotshot   s    
	
	c         C   s�   t  j t � } | j �  | j d d d d d t d d d d	 �| j |  � \ } }  t |  � d
 k ry | j d � d S|  d
 } t	 | | j
 |  d � S(
   Ns   -ps	   --profilet   actiont   storet   defaultt   destR   t   helps   Specify profile file to usei    s   missing script to executei   (   t   optparset   OptionParsert   __doc__t   disable_interspersed_argst
   add_optiont   PROFILEt
   parse_argst   lent
   print_helpR   R   (   R   t   parsert   optionsR   (    (    s1   /usr/lib64/python2.7/Tools/scripts/hotshotmain.pyt   main(   s    
t   __main__i   (   R   R   R   R   R   t
   hotshot.statsR"