???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................
].                 @   s  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l	 Z	 d d   Z
 g  Z d d   Z d d   Z d d	   Z d
 d   Z d d   Z d d d  Z d d d  Z Gd d   d  Z e   j Z d d d d d d  Z d S)    Nc               C   s   d S)Na'  <!--: spam
Content-Type: text/html

<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> -->
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
</table> </table> </table> </table> </table> </font> </font> </font> r   r   r   */opt/alt/python35/lib64/python3.5/cgitb.pyreset#   s    r   c             C   s   |  r d |  d Sd Sd  S)Nz<small>z</small> r   )textr   r   r   small.   s    r   c             C   s   |  r d |  d Sd Sd  S)Nz<strong>z	</strong>r   r   )r   r   r   r   strong4   s    r   c             C   s   |  r d |  d Sd Sd  S)Nz<font color="#909090">z</font>r   r   )r   r   r   r   grey:   s    r	   c             C   s   |  | k r d | |  f S|  | j  k r: d | j  |  f Sd | j  k r | j  d } t |  t i   k r |  | k r d | |  f Sn" t | |   r d t | |   f Sd  t f S)Nlocalglobal__builtins__builtin)	f_globalstypehasattrgetattr	__UNDEF__)nameframelocalsbuiltinsr   r   r   lookup@   s    r   c             C   s,  g  d  d  d t  f \ } } } } } xt j |   D] \ } }	 }
 } } | t j k rY P| t j k r |	 t j k r | d k r | t  k	 r t | |	 t   } | j | |	 | | f  qt	 |	 | |  \ } } | j |	 | | f  n/ |	 d k r| | d 7} | } n d \ } } |	 } q4 W| S)Nr   .)Nr   )
r   tokenizegenerate_tokensNEWLINENAMEkeywordkwlistr   appendr   )readerr   r   varsZ	lasttokenparentprefixvalueZttypetokenstartendlinewherer   r   r   scanvarsP   s"    $% 	
r*      c       "   
      s  |  \ } } } t  | t  r' | j } d t j j   d d t j } t j t j    } d t	 j
 j d t t	 j
 j t |    d d | d |  d	 } d
 t d d  d } g  }	 t j | |  }
 x|
 D]\ }   } } } }   r+t j j      d   t	 j
 j    f } n
 d   } t j |  \ } } } } d } | d k rd t |  t j | | | | d d d   } i   | g    f d d  } t | | |  } d d | | f g } | d  k	 r| | } x | D] } t d d t t |   t |   d } |  k rjd | t	 j
 j |  f } | j d |  n3 d | t	 j
 j |  f } | j d t |   | d 7} qWi  g  } } x | D] \ } } }  | | k rqd | | <|  t k	 rt| d, k rd  | t |  } n8 | d! k r1t |  } n | t | j d"  d-  } | j d# | t	 j
 j |   f  q| j | d$  qW| j d t t d% j |     |	 j d& d' j |   q Wd( t t	 j
 j t |    t	 j
 j t |   f g }! xb t |  D]T } | d  d  d) k r6qt	 j
 j t  | |   }  |! j d* | | |  f  qW| d j |	  d j |!  d+ t	 j
 j d j t! j" | | |    S).NzPython r   z: z<body bgcolor="#f0f0f8">z<big><big>%s</big></big>z#ffffffz#6622aaz<br>z
<p>A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.</p>z<tt>z&nbsp;r+   z&nbsp;</tt>z<a href="file://%s">%s</a>?r   zin formatvaluec             S   s   d t  j j |   S)N=)pydochtmlrepr)r$   r   r   r   <lambda>   s    zhtml.<locals>.<lambda>c                s<   d  |  d <z t  j   |  d  SWd  |  d d 7<Xd  S)N   r   )	linecachegetline)lnum)file	highlightr   r   r       s     zhtml.<locals>.readerz+<tr><td bgcolor="#d8bbff">%s%s %s</td></tr>z<big>&nbsp;</big>z<tt>=&gt;%s%s</tt>z&<tr><td bgcolor="#ffccee">%s</td></tr>z<tt>&nbsp;&nbsp;%s%s</tt>z<tr><td>%s</td></tr>r3   r   r   z<em>%s</em> r
   r   z%s&nbsp;= %sz <em>undefined</em>z, zF
<table width="100%%" cellspacing=0 cellpadding=0 border=0>
%s</table>
z	<p>%s: %s_z
<br>%s%s&nbsp;=
%sz


<!-- The above is a description of an error in a Python program, formatted
     for a Web browser because the 'cgitb' module was enabled.  In case you
     are not reading this in a Web browser, here is the original traceback:

%s
-->
)r   r   )#
isinstancer   __name__sysversionsplit
executabletimectimer/   r0   headingr   escapestrr   inspectgetinnerframesospathabspathgetargvaluesformatargvaluesr*   lenZ	preformatr   r	   r   r1   joindirr   	tracebackformat_exception)"einfocontextetypeevalueetbpyverdateheadindentframesrecordsr   r6   funclinesindexlinkargsvarargsvarkwr   callr    r!   rowsir(   numdonedumpr   r)   r$   	exceptionr   )r7   r8   r   r0   e   s|    	"@

. 
&& 	r0   c           
      s]  |  \ } } } t  | t  r' | j } d t j j   d d t j } t j t j    } d t	 |  | | f d } g  } t
 j | |  }	 x|	 D]\ }
   } } } }   r t j j    p d   t
 j |
  \ } } } } d } | d k r)d | t
 j | | | | d	 d
 d   } i   | g    f d d  } t | |
 |  } d   | f g } | d  k	 r| | } x9 | D]1 } d | } | j | | j    | d 7} qWi  g  } } x | D] \ } } } | | k rqd | | <| t k	 rk| d k r"d | } n# | d k rE| | j d  d } | j d | t j j |  f  q| j | d  qW| j d j |   | j d d j |   q Wd t	 |  t	 |  f g } xI t |  D]; } t j j t | |   } | j d d | | f  qW| d j |  d j |  d d j t j | | |   S) NzPython r   z: z	%s
%s
%s
z
A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.
r,   r   zin r-   c             S   s   d t  j j |   S)Nr.   )r/   r   r1   )r$   r   r   r   r2      s    ztext.<locals>.<lambda>c                s<   d  |  d <z t  j   |  d  SWd  |  d d 7<Xd  S)Nr3   r   )r4   r5   )r6   )r7   r8   r   r   r       s     ztext.<locals>.readerz %s %sz%5d r3   r   zglobal r
   r   z%s = %sz
 undefinedr9   z
%s
z%s: %sz

%s%s = %s    zc

The above is a description of an error in a Python program.  Here is
the original traceback:

%s
r;   z    )r<   r   r=   r>   r?   r@   rA   rB   rC   rF   rG   rH   rI   rJ   rK   rL   rM   r*   r   rstripr   r/   r   r1   rO   rP   r   rQ   rR   ) rS   rT   rU   rV   rW   rX   rY   rZ   r\   r]   r   r6   r^   r_   r`   rb   rc   rd   r   re   r    r!   rf   rg   r(   rh   ri   rj   r   r)   r$   rk   r   )r7   r8   r   r      s^    	"

 
  &r   c               @   sF   e  Z d  Z d d d d d d d  Z d d   Z d d	 d
  Z d S)Hookr3   Nr+   r0   c             C   s:   | |  _  | |  _ | |  _ | p' t j |  _ | |  _ d  S)N)displaylogdirrT   r>   stdoutr7   format)selfrp   rq   rT   r7   rs   r   r   r   __init__  s
    			zHook.__init__c             C   s   |  j  | | | f  d  S)N)handle)rt   rU   rV   rW   r   r   r   __call__  s    zHook.__call__c       
      C   s  | p t  j   } |  j d k r4 |  j j t    |  j d k rI t pL t } d } y | | |  j  } Wn& d j	 t
 j |    } d } Yn X|  j r | r | j d d  j d d  } |  j j d	 | d
  q|  j j | d  n |  j j d  |  j d  k	 rd d g |  j d k } t j d | d |  j  \ } } y7 t j | d   } | j |  Wd  QRXd | }	 Wn d | }	 Yn X|  j d k r|  j j d |	  n |  j j |	 d  y |  j j   Wn Yn Xd  S)Nr0   Fr   T&z&amp;<z&lt;z<pre>z</pre>
r9   z*<p>A problem occurred in a Python script.
z.txtz.htmlsuffixrP   wz*%s contains the description of this error.z*Tried to save traceback to %s, but failed.z
<p>%s</p>
)r>   exc_infors   r7   writer   r0   r   rT   rO   rQ   rR   rp   replacerq   tempfilemkstemprI   fdopenflush)
rt   info	formatterZplaindocrz   fdrJ   r7   msgr   r   r   rv     s@    	! zHook.handle)r=   
__module____qualname__ru   rw   rv   r   r   r   r   ro      s   ro   r3   c          	   C   s(   t  d |  d | d | d |  t _ d  S)Nrp   rq   rT   rs   )ro   r>   
excepthook)rp   rq   rT   rs   r   r   r   enable8  s    r   )rG   r   r4   rI   r/   r>   r   rB   r   rQ   r   r   r   r   r	   r   r*   r0   r   ro   rv   handlerr   r   r   r   r   <module>   s*   
ZA7