ó
§xxTc           @   s·   d  d l  Z  d  d l Z d  d l Z d  d l Td  d l m Z d  d l m Z d  d l m	 Z	 d e j
 f d „  ƒ  YZ d f  d	 „  ƒ  YZ d
 e f d „  ƒ  YZ d f  d „  ƒ  YZ d S(   iÿÿÿÿN(   t   *(   t   ListedToplevel(   t   ScrolledList(   t   macosxSupportt   Idbc           B   s5   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s   | |  _  t j j |  ƒ d  S(   N(   t   guit   bdbt   Bdbt   __init__(   t   selfR   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR      s    	c         C   sC   |  j  | ƒ r |  j ƒ  d  S|  j | ƒ } |  j j | | ƒ d  S(   N(   t   in_rpc_codet   set_stept   _Idb__frame2messageR   t   interaction(   R	   t   framet   message(    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyt	   user_line   s
    
c         C   sF   |  j  | ƒ r |  j ƒ  d  S|  j | ƒ } |  j j | | | ƒ d  S(   N(   R
   R   R   R   R   (   R	   R   t   infoR   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyt   user_exception   s
    
c         C   sL   | j  j j d ƒ r t S| j } | j  j j d ƒ r; t S|  j | ƒ Sd  S(   Ns   rpc.pys   Debugger.py(   t   f_codet   co_filenamet   countt   Truet   f_backt   FalseR
   (   R	   R   t
   prev_frame(    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR
      s    	c         C   sf   | j  } | j } | j } t j j | ƒ } d | | f } | j d k rb d | | j f } n  | S(   Ns   %s:%st   ?s   %s: %s()(   R   R   t   f_linenot   ost   patht   basenamet   co_name(   R	   R   t   codet   filenamet   linenoR   R   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyt   __frame2message(   s    			(   t   __name__t
   __module__R   R   R   R
   R   (    (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR   
   s
   				
t   Debuggerc           B   sþ   e  Z d Z Z Z Z d d  „ Z d „  Z d d „ Z	 d „  Z
 d d „ Z d „  Z d „  Z d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d Z d „  Z d „  Z d „  Z d Z d Z d „  Z d „  Z d d „ Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   sM   | d  k r t |  ƒ } n  | |  _ | |  _ d  |  _ |  j ƒ  d |  _ d  S(   Ni    (   t   NoneR   t   pyshellt   idbR   t   make_guit   interacting(   R	   R(   R)   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR   7   s    			
c         G   s.   z d |  _  |  j j | Œ  SWd  d |  _  Xd  S(   Ni   i    (   R+   R)   t   run(   R	   t   args(    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR,   @   s    	c         C   sZ   |  j  r |  j j ƒ  d  S|  j r< |  j j ƒ  d  |  _ n  |  j j ƒ  |  j j ƒ  d  S(   N(	   R+   t   topt   bellt   stackviewert   closeR'   R(   t   close_debuggert   destroy(   R	   t   event(    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR1   G   s    		 c         C   sÕ  |  j  } | j |  _ | j |  _ } t | ƒ |  _ } |  j j d ƒ |  j j d ƒ | j d |  j ƒ |  j j	 d |  j ƒ t
 | ƒ |  _ } |  j j d d ƒ g  |  _ } t | d d d	 |  j ƒ|  _ } | j | ƒ t | d d
 d	 |  j ƒ|  _ } | j | ƒ t | d d d	 |  j ƒ|  _ } | j | ƒ t | d d d	 |  j ƒ|  _ } | j | ƒ t | d d d	 |  j ƒ|  _ } | j | ƒ x. | D]& } | j d d ƒ | j d d ƒ q¦Wt
 | ƒ |  _ } |  j j d d ƒ |  j s$t | ƒ |  j _ |  j j d ƒ n  t | d d d	 |  j  d |  j ƒ|  _! |  j! j" d d d d ƒ |  j# s‚t | ƒ |  j _# n  t | d d d	 |  j$ d |  j# ƒ|  _% |  j% j" d d d d ƒ |  j& sðt | ƒ |  j _& |  j& j d ƒ n  t | d d d	 |  j' d |  j& ƒ|  _( |  j( j" d d d d ƒ |  j) sNt | ƒ |  j _) n  t | d d d	 |  j* d |  j) ƒ|  _+ |  j+ j" d d d d ƒ t, | d d ƒ|  _- |  j- j d d ƒ t, | d d ƒ|  _. |  j. j d d d d ƒ |  j. j/ d ƒ |  _0 t
 | d d ƒ|  _1 |  j1 j d d d d  ƒ t
 | ƒ |  _2 |  j2 j d d d d  ƒ t
 | d d ƒ|  _3 |  j3 j d d d d  ƒ |  j j4 ƒ  r™|  j  ƒ  n  |  j& j4 ƒ  rµ|  j' ƒ  n  |  j) j4 ƒ  rÑ|  j* ƒ  n  d  S(!   Ns   Debug Controlt   Debugt   WM_DELETE_WINDOWs   <Escape>t   anchort   wt   textt   Got   commandt   Stept   Overt   Outt   Quitt   statet   disabledt   sidet   lefti   t   Stackt   variablet   rowi    t   columnt   Sourcet   Localst   Globalst   fillt   xt
   backgroundt   heightt   expandt   both(5   R(   t   flistt   rootR   R.   t   wm_titlet   wm_iconnamet   wm_protocolR1   t   bindt   Framet   bframet   packt   buttonst   Buttont   contt   bcontt   appendt   stept   bstept   nextt   bnextt   rett   brett   quitt	   configuret   cframet   vstackt
   BooleanVart	   __class__t   sett   Checkbuttont
   show_stackt   bstackt   gridt   vsourcet   show_sourcet   bsourcet   vlocalst   show_localst   blocalst   vglobalst   show_globalst   bglobalst   Labelt   statust   errort   cgett   errorbgt   fstackt   flocalst   fglobalst   get(   R	   R(   RR   R.   RX   t   blt   bRg   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR*   T   s‚    	"""""								c         C   sÓ  | |  _  |  j j d | ƒ | rž | \ } } } y | j } Wn! t k
 ra d t | ƒ } n X| d  k	 r• y d | t | ƒ f } Wq• q• Xn  d } n d } d  } |  j } |  j j d | d | ƒ |  j	 }	 |	 r|  j
 j |  j  | ƒ \ }
 } |	 j |
 | ƒ n  |  j d ƒ |  j j ƒ  r5|  j ƒ  n  x! |  j D] } | j d d	 ƒ q?W|  j j ƒ  |  j j ƒ  x! |  j D] } | j d d
 ƒ q}W|  j j d d ƒ |  j j d d d |  j ƒ d  |  _  d  S(   NR9   s   %ss   %s: %st   yellowt    RM   i   R@   t   normalRA   (   R   Rz   Rf   R$   t   AttributeErrort   strR'   R}   R{   R0   R)   t	   get_stackt
   load_stackt   show_variablesRp   R�   t   sync_source_lineRZ   R.   t   wakeupRR   t   mainloop(   R	   R   R   R   t   typet   valuet   tbt   m1t   bgt   svt   stackt   iRƒ   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR   Ÿ   sD    				c         C   sl   |  j  } | s d  S|  j | ƒ \ } } | d  | d d k rh t j j | ƒ rh |  j j | | ƒ n  d  S(   Ni   iÿÿÿÿs   <>(   R   t   _Debugger__frame2filelineR   R   t   existsRQ   t   gotofileline(   R	   R   R!   R"   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRŒ   Ë   s    	*c         C   s%   | j  } | j } | j } | | f S(   N(   R   R   R   (   R	   R   R    R!   R"   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyt   __frame2filelineÓ   s    			c         C   s   |  j  j ƒ  |  j j ƒ  d  S(   N(   R)   t   set_continueRR   Re   (   R	   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR\   Ù   s    c         C   s   |  j  j ƒ  |  j j ƒ  d  S(   N(   R)   R   RR   Re   (   R	   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR_   Ý   s    c         C   s$   |  j  j |  j ƒ |  j j ƒ  d  S(   N(   R)   t   set_nextR   RR   Re   (   R	   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRa   á   s    c         C   s$   |  j  j |  j ƒ |  j j ƒ  d  S(   N(   R)   t
   set_returnR   RR   Re   (   R	   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRc   å   s    c         C   s   |  j  j ƒ  |  j j ƒ  d  S(   N(   R)   t   set_quitRR   Re   (   R	   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRe   é   s    c         C   s»   |  j  ru |  j j ƒ  ru t |  j |  j |  ƒ |  _  } |  j r· |  j j |  j d  ƒ \ } } | j
 | | ƒ q· nB |  j  } | rª |  j j ƒ  rª d  |  _  | j ƒ  n  d |  j d <d  S(   Ni   RN   (   R0   Rh   R�   t   StackViewerR~   RQ   R   R)   R‰   R'   RŠ   R1   (   R	   R”   R•   R–   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRm   ï   s    			c         C   s    |  j  j ƒ  r |  j ƒ  n  d  S(   N(   Rp   R�   RŒ   (   R	   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRq   ü   s    c         C   s   | d |  _  |  j ƒ  d  S(   Ni    (   R   R‹   (   R	   t	   stackitem(    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyt
   show_frame   s    c         C   sp   |  j  } |  j j ƒ  r9 | sb t |  j d ƒ |  _  qb n) | rb d  |  _  | j ƒ  d |  j d <n  |  j ƒ  d  S(   NRI   i   RN   (   t   localsviewerRs   R�   t   NamespaceViewerR   R'   R1   R‹   (   R	   t   lv(    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRt     s    		
c         C   sp   |  j  } |  j j ƒ  r9 | sb t |  j d ƒ |  _  qb n) | rb d  |  _  | j ƒ  d |  j d <n  |  j ƒ  d  S(   NRJ   i   RN   (   t   globalsviewerRv   R�   R£   R€   R'   R1   R‹   (   R	   t   gv(    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRw     s    		
i    c         C   s¯   |  j  } |  j } |  j } | s. d  } } n3 | j } | j } | ra | ra | | k ra d  } n  | r† | j | | |  j j j	 ƒ n  | r« | j | | |  j j j	 ƒ n  d  S(   N(
   R¢   R¥   R   R'   t   f_localst	   f_globalst	   load_dictR(   t   interpt   rpcclt(   R	   t   forceR¤   R¦   R   t   ldictt   gdict(    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR‹     s    						c         C   s   |  j  j | | ƒ d  S(   N(   R)   t	   set_break(   R	   R!   R"   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyt   set_breakpoint_here/  s    c         C   s   |  j  j | | ƒ d  S(   N(   R)   t   clear_break(   R	   R!   R"   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyt   clear_breakpoint_here2  s    c         C   s   |  j  j | ƒ d  S(   N(   R)   t   clear_all_file_breaks(   R	   R!   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyt   clear_file_breaks5  s    c         C   su   |  j  j j j ƒ  } xY | D]Q } | j j } y( x! | j D] } |  j | | ƒ q; WWq t k
 rl q q Xq Wd S(   s=   Load PyShellEditorWindow breakpoints into subprocess debuggerN(	   R(   RQ   t   inversedictt   keyst   ioR!   t   breakpointsR°   R‡   (   R	   t   pyshell_edit_windowst   editwinR!   R"   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyt   load_breakpoints8  s    N(    R$   R%   R'   Rh   Rp   Rs   Rv   R   R,   R1   R*   R   RŒ   R—   R\   R_   Ra   Rc   Re   R0   Rm   Rq   R¡   R¢   R¥   Rt   Rw   R‹   R°   R²   R´   R»   (    (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR&   3   s4   			K,															RŸ   c           B   s\   e  Z d  „  Z d	 d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z RS(
   c         C   sT   t  j ƒ  r t j |  | ƒ n t j |  | d d ƒ| |  _ | |  _ g  |  _ d  S(   Nt   widthiP   (   R   t   isAquaTkR   R   RQ   R   R•   (   R	   t   masterRQ   R   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR   E  s    		c         C   s3  | |  _  |  j ƒ  xý t t | ƒ ƒ D]é } | | \ } } y | j d } Wn d } n X| j } | j } | j }	 d d  l }
 |
 j	 | | ƒ } d d  l
 } | j | ƒ } |	 d k rÓ d | | | f } n d | |	 | | f } | | k rd | } n  |  j | ƒ q& W| d  k	 r/|  j | ƒ n  d  S(	   NR$   R   iÿÿÿÿR…   s   %s, line %d: %ss   %s.%s(), line %d: %ss   > (   R   R…   N(   R•   t   cleart   ranget   lenR¨   R   R   R   t	   linecachet   getlinet   stringt   stripR'   R^   t   select(   R	   R•   t   indexR–   R   R"   t   modnameR    R!   t   funcnameRÂ   t
   sourcelineRÄ   t   item(    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRŠ   Q  s0    	

				c         C   s   |  j  r t j |  | ƒ Sd S(   s   override base methodN(   R•   R   t   popup_event(   R	   R4   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRÌ   l  s    	c         C   s?   |  j  } | j d d d |  j ƒ | j d d d |  j ƒ d S(   s   override base methodt   labels   Go to source lineR;   s   Show stack frameN(   t   menut   add_commandt   goto_source_linet   show_stack_frame(   R	   RÎ   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyt	   fill_menuq  s
    	
c         C   sC   d | k o  t  |  j ƒ k  n r? |  j j |  j | ƒ n  d S(   s   override base methodi    N(   RÁ   R•   R   R¡   (   R	   RÇ   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyt	   on_selecty  s    %c         C   s   |  j  | ƒ d S(   s   override base methodN(   Rq   (   R	   RÇ   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyt	   on_double~  s    c         C   s#   |  j  j d ƒ } |  j | ƒ d  S(   Nt   active(   t   listboxRÇ   Rq   (   R	   RÇ   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRÐ   ‚  s    c         C   sU   |  j  j d ƒ } d | k o2 t |  j ƒ k  n rQ |  j j |  j | ƒ n  d  S(   NRÕ   i    (   RÖ   RÇ   RÁ   R•   R   R¡   (   R	   RÇ   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRÑ   †  s    %c         C   s�   d | k o  t  |  j ƒ k  n s) d  S|  j | \ } } | j } | j } t j j | ƒ r‹ |  j j | ƒ } | r‹ | j	 | ƒ q‹ n  d  S(   Ni    (
   RÁ   R•   R   R   R   R   t   isfileRQ   t   opent   gotoline(   R	   RÇ   R   R"   R    R!   t   edit(    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRq   ‹  s    %		N(   R$   R%   R   R'   RŠ   RÌ   RÒ   RÓ   RÔ   RÐ   RÑ   Rq   (    (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyRŸ   C  s   							R£   c           B   s2   e  Z d d  „ Z d Z d d d „ Z d „  Z RS(   c      	   C   s±  d } d } | r% d t  | ƒ } n  | |  _ | |  _ d d  l } | j ƒ  |  _ d |  j _ d |  j _ t | ƒ |  _ } |  j j	 d d d d	 ƒ t
 | d
 | d d d d ƒ|  _ |  j j	 d d ƒ t | d d ƒ|  _ } | j	 d d d d ƒ t | d t d t d | ƒ ƒ d d d | | f ƒ|  _ }	 |	 j	 d d d d	 d d ƒ |	 j | d <| j |	 d <t |	 ƒ |  _ }
 |	 j d d d |
 d d ƒ|  _ |  j | ƒ d  S(   Ni    i(   i   iÿÿÿÿi<   RO   i   RK   RP   R9   t   borderwidthi   t   relieft   grooveRL   t   namet   vbarRB   t   rightt   yRN   i,  t   scrollregionRC   R;   t   yscrollcommandt   windowR7   t   nw(   RÁ   R¾   t   titlet   reprt   Reprt	   maxstringt   maxotherRW   R   RY   Ry   RÍ   t	   ScrollbarRß   t   Canvast   mint   maxt   canvast   yviewRk   t   subframet   create_windowt   sfidR©   (   R	   R¾   Ræ   t   dictR¼   RN   Rç   R   Rß   Rï   Rñ   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR   ™  s2    		!	!iÿÿÿÿi    c         C   sù  | |  j  k r | r d  S|  j } |  j } x! | j j ƒ  D] } | j ƒ  q< Wd  |  _  | sŠ t | d d ƒ} | j d d d d ƒ nÛ | j	 ƒ  } | j
 ƒ  d }	 x¼ | D]´ }
 | |
 } |  j j | ƒ } | rå | d d !} n  t | d |
 ƒ} | j d |	 d d d d	 ƒ t | d
 d d d ƒ} | j d | ƒ | j d |	 d d d d	 ƒ |	 d }	 q­ W| |  _  | j ƒ  | j ƒ  } | j ƒ  } |  j } d d | | f |  j d <| d k rÛd | d <| j d d ƒ n | | d <| j d d ƒ d  S(   NR9   R'   RF   i    RG   i   iÿÿÿÿt   stickyRå   R¼   RÛ   Râ   i,  RN   RO   (   Rô   Rñ   R   t   childrent   valuesR3   R'   Ry   Ro   R¶   t   sortRç   t   Entryt   insertt   update_idletaskst   winfo_reqwidtht   winfo_reqheightRï   RY   (   R	   Rô   R¬   t
   rpc_clientRñ   R   t   ct   lt   namesRF   RÞ   R�   t   svalueR¼   RN   Rï   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR©   ¶  sF    			

	
	

c         C   s   |  j  j ƒ  d  S(   N(   R   R3   (   R	   (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR1   à  s    N(   R$   R%   R'   R   Rô   R©   R1   (    (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyR£   —  s   *(   R   R   t   typest   Tkintert   idlelib.WindowListR   t   idlelib.ScrolledListR   t   idlelibR   R   R   R&   RŸ   R£   (    (    (    s<   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/Debugger.pyt   <module>   s   
)ÿ T