509318396
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
ó
wWS`c           @  s¢  d  d l  m 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 l Z d  d l Z d  d l m Z d  d l m Z m Z y d  d l TWn1 e k
 rû e d d e j ƒe j d ƒ n Xd  d l Z d  d	 l m Z m Z d  d
 l m Z d  d l m Z d  d l m  Z  d  d l! m" Z" d  d l# m$ Z$ d  d l% m& Z& d  d l% m' Z' d  d l% m( Z( d  d l% m) Z) d  d l% m* Z* e j+ e j, d Z- d Z. d Z/ y d  d l0 m1 Z1 Wn e k
 rd Z1 n Xe j a2 d  d l3 Z3 e4 d „ Z5 e4 e4 d „ Z6 e4 a7 d „  Z8 e8 e9 ƒ e4 e j: d „ Z; e; e _: d e f d „  ƒ  YZ< d e f d  „  ƒ  YZ= d! e f d" „  ƒ  YZ> d# e  f d$ „  ƒ  YZ? d% e& j@ f d& „  ƒ  YZA d' e f d( „  ƒ  YZB d) e" f d* „  ƒ  YZC d+ e jD f d, „  ƒ  YZE d- eE f d. „  ƒ  YZF d/ eE f d0 „  ƒ  YZG d1 „  ZH d2 ZI d3 „  ZJ eK d4 k r”e jL d4 e jL d) <eJ ƒ  n  e8 eM ƒ d S(5   iÿÿÿÿ(   t   print_functionN(   t   InteractiveInterpreter(   t   python_versiont   system(   t   *sJ   ** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **t   filei   (   t   EditorWindowt   fixwordbreaks(   t   FileList(   t   ColorDelegator(   t   UndoDelegator(   t   OutputWindow(   t   idleConf(   t   rpc(   t   Debugger(   t   RemoteDebugger(   t   macosxSupport(   t	   IOBindingt   _s	   127.0.0.1i    (   t   SIGTERMi   c         C  sy   d } | d | | f 7} | d k r; t j | | ƒ } n  | j ƒ  } | r^ | d | 7} n  | d | j |  f 7} | S(   s   Format warnings the IDLE way.s!   
Warning (from warnings module):
s     File "%s", line %s
s       %s
s   %s: %s
N(   t   Nonet	   linecachet   getlinet   stript   __name__(   t   messaget   categoryt   filenamet   linenot   linet   s(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   idle_formatwarning7   s    c         C  sf   | d k r t } n  y3 | j t |  | | | d | ƒƒ | j d ƒ Wn t t f k
 ra n Xd S(   s   Show Idle-format warning (after replacing warnings.showwarning).

    The differences are the formatter called, the file=None replacement,
    which can be None, the capture of the consequence AttributeError,
    and the output of a hard-coded prompt.
    R   s   >>> N(   R   t   warning_streamt   writeR   t   AttributeErrort   IOError(   R   R   R   R   R   R   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   idle_showwarningD   s    		c         C  sL   |  r* t  d k rH t j a  t t _ qH n t  d k	 rH t  t _ d a  n  d S(   s>   Replace warning.showwarning with idle_showwarning, or reverse.N(   t   _warnings_showwarningR   t   warningst   showwarningR$   (   t   capture(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   capture_warningsW   s    		c         C  so   t  j } i  } xB t | ƒ D]4 } | d  | d d k r | j | ƒ | | <q q W| |  ƒ | j | ƒ d S(   so  Extend linecache.checkcache to preserve the <pyshell#...> entries

    Rather than repeating the linecache code, patch it to save the
    <pyshell#...> entries, call the original linecache.checkcache()
    (skipping them), and then restore the saved entries.

    orig_checkcache is bound at definition time to the original
    method, allowing it to be patched.
    i   iÿÿÿÿs   <>N(   R   t   cachet   listt   popt   update(   R   t   orig_checkcacheR*   t   savet   key(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   extended_linecache_checkcachef   s    	
t   PyShellEditorWindowc           B  s�   e  Z d  Z d „  Z d d d d d g Z e d „ Z d „  Z d d „ Z	 d d „ Z
 d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s6   Regular text edit window in IDLE, supports breakpointsc         G  sÈ   g  |  _  t j |  | Œ |  j j d |  j ƒ |  j j d |  j ƒ |  j j d |  j j ƒ t	 j
 j t j ƒ  d ƒ |  _ |  j j |  d „ } |  j j | ƒ |  j j rº |  j ƒ  n  |  j ƒ  d  S(   Ns   <<set-breakpoint-here>>s   <<clear-breakpoint-here>>s   <<open-python-shell>>s   breakpoints.lstc         S  s   | j  ƒ  |  ƒ  d  S(   N(   t   restore_file_breaks(   t   old_hookt   self(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   filename_changed_hookŠ   s    
(   t   breakpointsR   t   __init__t   textt   bindt   set_breakpoint_heret   clear_breakpoint_heret   flistt
   open_shellt   ost   patht   joinR   t   GetUserCfgDirt   breakpointPatht   iot   filename_change_hookt   set_filename_change_hookR   R3   t   color_breakpoint_text(   R5   t   argsR6   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR8   €   s    		t   Cuts   <<cut>>t   rmenu_check_cutt   Copys   <<copy>>t   rmenu_check_copyt   Pastes	   <<paste>>t   rmenu_check_pastes   Set Breakpoints   <<set-breakpoint-here>>s   Clear Breakpoints   <<clear-breakpoint-here>>c         C  se   |  j  d k r d S| r: t j ƒ  } t j | d ƒ } n i d d 6d d 6} |  j j d | ƒ d S(   s,   Turn colorizing of breakpoint text on or offNt   breakt    t
   foregroundt
   backgroundt   BREAK(   RD   R   R   t   CurrentThemet   GetHighlightR9   t
   tag_config(   R5   t   colort   themet   cfg(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRG   ›   s    c         C  s    |  j  } |  j j } | j d d | d | d ƒ y |  j j | ƒ Wn! t k
 rk |  j j | ƒ n Xy& |  j j	 j
 j } | j | | ƒ Wn n Xd  S(   NRS   s   %d.0i   (   R9   RD   R   t   tag_addR7   t   indext
   ValueErrort   appendR=   t   pyshellt   interpt   debuggerR;   (   R5   R   R9   R   t   debug(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   set_breakpoint§   s    	c         C  sU   |  j  } |  j j } | s) | j ƒ  d  St t | j d ƒ ƒ ƒ } |  j | ƒ d  S(   Nt   insert(   R9   RD   R   t   bellt   intt   floatR[   Rb   (   R5   t   eventR9   R   R   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR;   µ   s    	
c         C  s©   |  j  } |  j j } | s) | j ƒ  d  St t | j d ƒ ƒ ƒ } y |  j j | ƒ Wn n X| j	 d d d ƒ y& |  j
 j j j } | j | | ƒ Wn n Xd  S(   NRc   RS   s   insert linestarts   insert lineend +1char(   R9   RD   R   Rd   Re   Rf   R[   R7   t   removet
   tag_removeR=   R^   R_   R`   R<   (   R5   Rg   R9   R   R   Ra   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR<   ¾   s"    	
c         C  s‚   |  j  r~ |  j } |  j j } | s2 | j ƒ  d  Sg  |  _  | j d d t ƒ y# |  j j j	 j
 } | j | ƒ Wq~ q~ Xn  d  S(   NRS   s   1.0(   R7   R9   RD   R   Rd   Ri   t   ENDR=   R^   R_   R`   t   clear_file_breaks(   R5   R9   R   Ra   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRk   Ñ   s    		
	c      	   C  sO  |  j  } |  j j } y+ t |  j d ƒ � } | j ƒ  } Wd QXWn t k
 rY g  } n XyŽ t |  j d ƒ �v } x1 | D]) } | j | d ƒ sy | j | ƒ qy qy W|  j	 ƒ  |  j  } | rá | j | d t
 | ƒ d ƒ n  Wd QXWn` t k
 rJ} t |  j d t ƒ sKt |  j _ t j d d d	 d
 t
 | ƒ d |  j ƒ qKn Xd S(   s#   Save breakpoints when file is savedt   rNt   wt   =s   
t   breakpoint_error_displayedt   titles
   IDLE ErrorR   s$   Unable to update breakpoint list:
%st   parent(   R7   RD   R   t   openRC   t	   readlinesR#   t
   startswithR!   t   update_breakpointst   strt   getattrt   roott   Falset   TrueRo   t   tkMessageBoxt	   showerrorR9   (   R5   t   breaksR   t   old_filet   linest   new_fileR   t   err(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   store_file_breaksà   s.    	

	,c         C  sÏ   |  j  j ƒ  |  j d  k r  d  S|  j j } | d  k r< d  St j j |  j ƒ rË t	 |  j d ƒ j
 ƒ  } x_ | D]T } | j | d ƒ rp t | t | ƒ d ƒ } x | D] } |  j | ƒ qª Wqp qp Wn  d  S(   NRl   Rn   i   (   R9   R-   RD   R   R   R?   R@   t   isfileRC   Rr   Rs   Rt   t   evalt   lenRb   (   R5   R   R   R   t   breakpoint_linenumberst   breakpoint_linenumber(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR3   
  s    c         C  s4   |  j  } | j d ƒ } |  j | ƒ } | |  _ d S(   s3   Retrieves all the breakpoints in the current windowRS   N(   R9   t
   tag_rangest   ranges_to_linenumbersR7   (   R5   R9   t   rangest   linenumber_list(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRu     s    	c         C  s�   g  } x€ t  d t | ƒ d ƒ D]f } t t | | j ƒ ƒ } t t | | d j ƒ ƒ } x' | | k  r„ | j | ƒ | d 7} q^ Wq W| S(   Ni    i   i   (   t   rangeR…   Re   Rf   t   stringR]   (   R5   RŠ   R   R[   R   t   end(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR‰   !  s    c         C  s   |  j  ƒ  t j |  ƒ d S(   s7   Extend base method - clear breaks when module is closedN(   Rk   R   t   _close(   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�   2  s    
(   RI   s   <<cut>>RJ   (   RK   s   <<copy>>RL   (   RM   s	   <<paste>>RN   N(   s   Set Breakpoints   <<set-breakpoint-here>>N(   s   Clear Breakpoints   <<clear-breakpoint-here>>N(   R   t
   __module__t   __doc__R8   R   t   rmenu_specsRz   RG   Rb   R;   R<   Rk   R‚   R3   Ru   R‰   R�   (    (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR2   }   s"   						*			t   PyShellFileListc           B  s&   e  Z d  Z e Z d Z d d „ Z RS(   s8   Extend base class: IDLE supports a shell and breakpointsc         C  sQ   |  j  r |  j  j j ƒ  n. t |  ƒ |  _  |  j  rJ |  j  j ƒ  sJ d  Sn  |  j  S(   N(   R^   t   topt   wakeupt   PyShellt   beginR   (   R5   Rg   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR>   A  s    		N(   R   R�   R‘   R2   R   R   R^   R>   (    (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR“   8  s   t   ModifiedColorDelegatorc           B  s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   s8   Extend base class: colorizer for the shell window itselfc         C  s   t  j |  ƒ |  j ƒ  d  S(   N(   R	   R8   t   LoadTagDefs(   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR8   O  s    c         C  s7   |  j  d d d ƒ |  j d d d ƒ t j |  ƒ d  S(   Nt   TODOs   1.0t   iomarkt   SYNC(   Ri   RZ   R	   t   recolorize_main(   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�   S  s    c         C  s{   t  j |  ƒ t j ƒ  } |  j j i i d  d 6d  d 6d 6t j | d ƒ d 6t j | d ƒ d 6t j | d ƒ d 6ƒ d  S(   NRR   RQ   t   stdint   stdoutt   stderrt   console(   R	   R™   R   RT   t   tagdefsR-   R   RU   (   R5   RX   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR™   X  s    c         C  s+   x$ |  j  D] } |  j | d d ƒ q
 Wd  S(   NR›   RŽ   (   R¢   Ri   (   R5   t   tag(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   removecolorsb  s    (   R   R�   R‘   R8   R�   R™   R¤   (    (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR˜   L  s
   			
t   ModifiedUndoDelegatorc           B  s&   e  Z d  Z d d „ Z d d „ Z RS(   s;   Extend base class: forbid insert/delete before the I/O markc         C  s[   y- |  j  j | d d ƒ r, |  j  j ƒ  d  SWn t k
 r@ n Xt j |  | | | ƒ d  S(   Nt   <R›   (   t   delegatet   compareRd   t   TclErrorR
   Rc   (   R5   R[   t   charst   tags(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRc   j  s    c         C  sX   y- |  j  j | d d ƒ r, |  j  j ƒ  d  SWn t k
 r@ n Xt j |  | | ƒ d  S(   NR¦   R›   (   R§   R¨   Rd   R©   R
   t   delete(   R5   t   index1t   index2(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR¬   s  s    N(   R   R�   R‘   R   Rc   R¬   (    (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR¥   g  s   	t   MyRPCClientc           B  s   e  Z d  „  Z RS(   c         C  s
   t  ‚ d S(   s0   Override the base class - just re-raise EOFErrorN(   t   EOFError(   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt
   handle_EOF  s    (   R   R�   R±   (    (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR¯   }  s   t   ModifiedInterpreterc           B  sI  e  Z d  „  Z d  Z d  Z d  Z d „  Z d „  Z d „  Z	 e
 d d „ Z d „  Z d „  Z d „  Z d	 „  Z e
 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  d „ Z d „  Z d „  Z  d „  Z! d „  Z" d „  Z# d „  Z$ d „  Z% d „  Z& d „  Z' RS(!   c         C  sf   | |  _  t j d j } t j |  d | ƒd  |  _ t |  _	 d  |  _
 t |  _ |  j j j |  _ d  S(   Nt   __main__t   locals(   t	   tkconsolet   syst   modulest   __dict__R   R8   R   t   save_warnings_filtersRy   t
   restartingt   subprocess_arglistt   PORTt   portt   compilet   compilert   flagst   original_compiler_flags(   R5   Rµ   R´   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR8   †  s    					c         C  sL   |  j  d  k r! |  j ƒ  |  _  n  |  j  } t j t j t j | ƒ |  _ d  S(   N(	   R»   R   t   build_subprocess_arglistR?   t   spawnvt   P_NOWAITR¶   t
   executablet   rpcpid(   R5   RH   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   spawn_subprocess”  s    	c         C  s  |  j  d k s t d ƒ ‚ g  t j D] } d | ^ q% } d d d k r[ | j d ƒ n  t j d d d	 d
 t d d ƒ} t d k r˜ d | f } n d | f } t j	 d  d k r× d t j
 k r× d t j
 } n	 t j
 } | g | d | t |  j  ƒ g S(   Ni    s/   Socket should have been assigned a port number.s   -Wi   i   s   -Qnewt   maint   Generals   delete-exitfunct   defaultt   typet   bools   idlelib.PyShells&   __import__('idlelib.run').run.main(%r)s   __import__('run').main(%r)i   t   wint    s   "%s"s   -c(   R½   t   AssertionErrorR¶   t   warnoptionsR]   R   t	   GetOptionRy   R   t   platformRÅ   Rv   (   R5   R   Rm   t	   del_exitft   commandt   decorated_exec(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRÂ   š  s    	 "	c         C  sÄ  t  |  j f } xZ t d ƒ D]> } t j | ƒ y t | ƒ |  _ PWq t j k
 rY q Xq W|  j	 ƒ  d  S|  j j j ƒ  d |  _ t d k r³ |  j j j t j t j d ƒ n  |  j ƒ  |  j j j d ƒ y |  j j ƒ  Wn t j k
 r|  j ƒ  d  SX|  j j d |  j ƒ |  j j d |  j j ƒ |  j j d |  j j ƒ |  j j d |  j j ƒ |  j j d	 |  j j ƒ |  j j d
 t ƒ |  j j d |  ƒ |  j d t ƒ |  j ƒ  |  j S(   Ni   i   i    i
   R¡   Rž   RŸ   R    R=   R   R_   t   with_cwd(    t   HOSTR½   RŒ   t   timet   sleepR¯   t   rpccltt   sockett   errort   display_port_binding_errorR   t   listening_sockt   getsocknameR¼   t
   setsockoptt
   SOL_SOCKETt   SO_REUSEADDRRÇ   t
   settimeoutt   acceptt   timeoutt   display_no_subprocess_errort   registerRµ   Rž   RŸ   R    R=   R   t   transfer_pathRz   t   poll_subprocess(   R5   t   addrt   i(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   start_subprocess°  s>    



RP   c         C  sº  |  j  r |  j St |  _  |  j ƒ  } | rL y t j |  j ƒ WqL qL Xn  |  j j ƒ  |  j ƒ  |  j } | j	 } t
 | _	 |  j ƒ  y |  j j ƒ  Wn t j k
 rº |  j ƒ  d  SX|  j d | ƒ | j ƒ  | j j d d ƒ d | r÷ | n d } t | j ƒ t | ƒ d d d } | j d	 j | | ƒ ƒ | j j d
 d ƒ | j j d
 d ƒ | su| j ƒ  n  | r˜t j |  j ƒ | j ƒ  n  |  j |  j  j! _" t
 |  _  |  j S(   NRÖ   R›   s   end-1cs	   RESTART: t   Shelli   i   Rn   s   
{0} {1} {0}t   restartt   left(#   Rº   RÚ   Rz   t   getdebuggerR   t   close_subprocess_debuggert   closet   unix_terminateRµ   t	   executingRy   RÇ   Rä   RÛ   Rå   Ræ   R   Rè   t   stop_readlineR9   R¬   Re   t   widthR…   R!   t   formatt   mark_sett   mark_gravityt
   showpromptt   restart_subprocess_debuggert   load_breakpointsRÁ   R¾   R¿   RÀ   (   R5   RÖ   R   Ra   R¡   t   was_executingR£   t   halfbar(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   restart_subprocessÛ  sH    		
			


%	c         C  s   |  j  j d d d i  ƒ d  S(   Nt   exect   interrupt_the_server(    (   RÚ   t
   remotecall(   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   __request_interrupt  s    c         C  s   t  j d |  j ƒ j ƒ  d  S(   Nt   target(   t	   threadingt   Threadt'   _ModifiedInterpreter__request_interruptt   start(   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   interrupt_subprocess  s    c         C  sp   |  j  d  k	 r( |  j j j |  j  ƒ n  y |  j j ƒ  Wn t k
 rL n X|  j ƒ  t	 |  j _
 d  |  _ d  S(   N(   t   _afteridR   Rµ   R9   t   after_cancelRÚ   Rò   R"   Ró   Ry   Rô   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   kill_subprocess  s    
c         C  sn   t  t d ƒ rj y t j |  j t ƒ Wn t k
 r: d SXy t j |  j d ƒ Wqj t k
 rf d SXn  d S(   s;   UNIX: make sure subprocess is terminated and collect statust   killNi    (   t   hasattrR?   R  RÆ   R   t   OSErrort   waitpid(   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRó     s    c         C  sC   | r" d g } | j  t j ƒ n	 t j } |  j d | f ƒ d  S(   NRP   sR   if 1:
        import sys as _sys
        _sys.path = %r
        del _sys
        
(   t   extendR¶   R@   t
   runcommand(   R5   RÖ   R@   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRè   '  s    		c         C  s¥  |  j  } | d  k r d  Sy | j |  j d d ƒ} Wn: t t t f k
 rq |  j j r^ d  Sd  } |  j	 ƒ  n X| rn|  j j
 ƒ  d  |  _ | \ } } |  j j } | d k rÚ | d  k	 rFt t | ƒ d | ƒqFnl | d k r|  j j d ƒ rF|  j ƒ  qFn> | d k rFd } t | | d t j ƒt | | d | ƒn  y |  j j ƒ  Wqnt k
 rjqnXn  |  j j s¡|  j j j |  j j |  j ƒ |  _ n  d  S(	   Nt   waitgš™™™™™©?t   OKR   t	   EXCEPTIONs   <<toggle-jit-stack-viewer>>t   ERRORs/   PyShell.ModifiedInterpreter: Subprocess ERROR:
(   RÚ   R   t   pollresponset
   active_seqR°   R#   t   KeyboardInterruptRµ   t   closingRÿ   t   resetoutputR¡   t   printt   reprt   getvart   remote_stack_viewerR¶   t
   __stderr__t   endexecutingR"   R9   t   aftert   pollintervalRé   R
  (   R5   t   cltt   responset   howt   whatR¡   t   errmsg(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRé   6  s@    		c         C  s   | |  _  d  S(   N(   R`   (   R5   R`   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   setdebugger^  s    c         C  s   |  j  S(   N(   R`   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRð   a  s    c         C  s   |  j  j j d |  j ƒ d S(   s’  Initiate the remote stack viewer from a separate thread.

        This method is called from the subprocess, and by returning from this
        method we allow the subprocess to unblock.  After a bit the shell
        requests the subprocess to open the remote stack viewer which returns a
        static object looking at the last exception.  It is queried through
        the RPC mechanism.

        i,  N(   Rµ   R9   R"  R  (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   open_remote_stack_viewerd  s    
c         C  sþ   d d l  m } |  j j d d d i  ƒ } | d  k rK |  j j j ƒ  d  S| j |  j | ƒ } d d l	 m
 } m } t |  j j ƒ } t j ƒ  } t j | d ƒ d } | | d	 | d
 d ƒ}	 |	 j j d d d d ƒ | |	 j d  | ƒ }
 |
 j ƒ  d  S(   Niÿÿÿÿ(   t   RemoteObjectBrowserR   t   stackviewerR=   (   t   ScrolledCanvast   TreeNodet   normalRR   t   bgt   highlightthicknessi    t   expandi   t   fillt   both(   R=   (   t   idlelibR+  RÚ   t   remotequeueR   Rµ   Rx   Rd   t   StubObjectTreeItemt   idlelib.TreeWidgetR-  R.  t   ToplevelR   RT   RU   t   framet   packt   canvasR2  (   R5   R+  t   oidt   itemR-  R.  R”   RX   RR   t   sct   node(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR  q  s    i    c         C  s#   |  j  | ƒ } |  j | | ƒ d S(   s1   Like runsource() but assumes complete exec sourceN(   t   stuffsourcet   execfile(   R5   t   sourceR   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt
   execsource„  s    c         C  s«   | d k r$ t | d ƒ j ƒ  } n  y t | | d d t ƒ} WnW t t f k
 r™ |  j j ƒ  t	 d d |  j j
 ƒt j |  | ƒ |  j j ƒ  n X|  j | ƒ d S(   s   Execute an existing fileRl   R   t   dont_inheritsB   *** Error in script or command!
Traceback (most recent call last):R   N(   R   Rr   t   readR¾   Rz   t   OverflowErrort   SyntaxErrorRµ   R  R  R    R   t   showsyntaxerrorRú   t   runcode(   R5   R   RC  t   code(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRB  ‰  s    	c         C  sõ   |  j  | ƒ } d |  _ t j |  _ t j d d d t ƒ t | t ƒ r® t	 j
 d k r® y# d t	 j
 | j t	 j
 ƒ f } Wq® t k
 rª |  j j ƒ  |  j d ƒ d SXn  z t j |  | | ƒ SWd |  j d k	 rð |  j t j (d |  _ n  Xd S(	   sB   Extend base class method: Stuff the source in the line cache firsti    t   actionRÜ   R   s   utf-8s   # -*- coding: %s -*-
%ss    Unsupported characters in input
N(   RA  t   moreR&   t   filtersR¹   t   filterwarningst   SyntaxWarningt
   isinstancet   unicodeR   t   encodingt   encodet   UnicodeErrorRµ   R  R!   R   t	   runsourceR   (   R5   RC  R   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRV  ™  s$    	c         C  sS   d |  j  } |  j  d |  _  | j d ƒ } t | ƒ d d | | f t j | <| S(   s"   Stuff source in the filename caches   <pyshell#%d>i   s   
i    (   t   gidt   splitR…   R   R*   (   R5   RC  R   R   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRA  ±  s
    #c         C  s   |  j  d | f ƒ d S(   s>   Prepend sys.path with file's directory if not already includeds(  if 1:
            _filename = %r
            import sys as _sys
            from os.path import dirname as _dirname
            _dir = _dirname(_filename)
            if not _dir in _sys.path:
                _sys.path.insert(0, _dir)
            del _filename, _sys, _dirname, _dir
            
N(   R  (   R5   R   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   prepend_syspath¹  s    c   
      C  s  |  j  j } |  j ƒ  } | rä | \ } } } } | d k rM d | d } n d | d | d f } | j d | ƒ | j | ƒ | j | ƒ }	 |	 r½ |	 t k r½ | j d | d | ƒ n  |  j  j ƒ  |  j d t	 | ƒ ƒ n |  j  j ƒ  t
 j |  | ƒ |  j  j ƒ  d S(   s˜   Extend base class method: Add Colorizing

        Color the offending position instead of printing it and pointing at it
        with a caret.

        i   s   iomark + %d charss&   iomark linestart + %d lines + %d charsR  s
    wordstarts   SyntaxError: %s
N(   Rµ   R9   t   unpackerrorRZ   t   seet   gett
   IDENTCHARSR  R!   Rv   R   RI  Rú   (
   R5   R   R9   t   stufft   msgR   t   offsetR   t   post   char(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRI  Å  s$    c   
      C  sƒ   t  j ƒ  \ } } } | t k } | re y+ | \ } \ } } } }	 | sQ d } n  Wqe d } qe Xn  | r{ | | | |	 f Sd  Sd  S(   Ni    (   R¶   t   exc_infoRH  R   (
   R5   RË   t   valuet   tbt   okR_  t   dummy_filenameR   R`  R   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRZ  á  s    c         C  sJ   |  j  j ƒ  |  j ƒ  t j |  ƒ |  j  j d ƒ rF |  j  j ƒ  n  d S(   s1   Extend base class method to reset output properlys   <<toggle-jit-stack-viewer>>N(   Rµ   R  t   checklinecacheR   t   showtracebackR  t   open_stack_viewer(   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRi  ð  s
    
c         C  sF   t  j } x6 | j ƒ  D]( } | d  | d d k r | | =q q Wd  S(   Ni   iÿÿÿÿs   <>(   R   R*   t   keys(   R5   t   cR0   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRh  ø  s    	c         B  sQ   |  j  j r |  j ƒ  d S|  j rB |  j j d d | f i  ƒ n | |  j Ud S(   s*   Run the code without invoking the debuggeri    R   RJ  i   (   Rµ   Rô   t   display_executing_dialogRÚ   R6  R´   (   R5   RK  (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR  þ  s    
	c         B  sÔ  |  j  j r |  j j ƒ  n  |  j ƒ  |  j d k	 rN |  j e j (d |  _ n  |  j	 } zGyr |  j  j
 ƒ  | r¤ |  j d k	 r¤ |  j j d d | f i  ƒ |  _ n' | rÀ | j | |  j ƒ n | |  j UWnÎ e k
 r%|  j  j se j d d d d d |  j  j ƒr‚  q"|  j ƒ  q�‚  nx e r^e d d	 |  j  j ƒ|  j ƒ  |  j  j ƒ  q�|  j  j r�e |  j  _ e d
 d	 |  j  j ƒq�|  j ƒ  n XWd e sÏy |  j  j ƒ  WqÏe k
 rËqÏXn  Xd S(   s   Override base class methodR   RJ  s   Exit?s   Do you want to exit altogether?RÊ   t   yesRq   s    IDLE internal error in runcode()R   R  N(   Rµ   Rô   R_   Rÿ   Rh  R¹   R   R&   RN  R`   t   beginexecutingRÚ   t
   asyncqueueR  t   runR´   t
   SystemExitR  R{   t   askyesnoR9   Ri  t   use_subprocessR  R    R!  t   canceledRy   R"   (   R5   RK  R`   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRJ  
  sR    
	 	
c         C  s   |  j  j j | ƒ d S(   s   Override base class methodN(   Rµ   R    R!   (   R5   R   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR!   ;  s    c         C  s    t  j d d d |  j j ƒd  S(   Ns   Port Binding ErrorsA  IDLE can't bind to a TCP/IP port, which is necessary to communicate with its Python execution server.  This might be because no networking is installed on this computer.  Run IDLE with the -n command line switch to start without a subprocess and refer to Help/IDLE Help 'Running without a subprocess' for further details.Rq   (   R{   R|   Rµ   R9   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRÝ   ?  s    c         C  s    t  j d d d |  j j ƒd  S(   Ns   Subprocess Startup Errors‰   IDLE's subprocess didn't make connection.  Either IDLE can't start a subprocess or personal firewall software is blocking the connection.Rq   (   R{   R|   Rµ   R9   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRæ   J  s    c         C  s    t  j d d d |  j j ƒd  S(   Ns   Already executingsY   The Python Shell window is already executing a command; please wait until it is finished.Rq   (   R{   R|   Rµ   R9   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRm  R  s    N((   R   R�   R8   R   R
  RÚ   RÆ   RÇ   RÂ   Rì   Ry   Rÿ   R  R	  R  Ró   Rè   R  Ré   R`   R)  Rð   R*  R  RW  RD  RB  RV  RA  RY  RI  RZ  Ri  Rh  R  RJ  R!   RÝ   Ræ   Rm  (    (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR²   „  sH   	
			+-					&													1			R–   c           B  s¸  e  Z d  e ƒ  d Z e Z e Z d2 d3 d4 d5 d6 d7 g Z d d l	 m
 Z
 d8 d „ Z d „  Z e Z e Z e Z e Z e Z e Z d „  Z d „  Z d8 d „ Z d „  Z d8 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& d8 d$ „ Z' d% „  Z( d& „  Z) d' „  Z* d( „  Z+ d) „  Z, d8 d* „ Z- d8 d+ „ Z. d8 d, „ Z/ d- „  Z0 d. „  Z1 d9 d/ „ Z2 d0 „  Z3 d1 „  Z4 RS(:   s   Python s    ShellR   t   _Filet   editt   _EditRa   t   _Debugt   optionst   _Optionst   windowst   _Windowt   helpt   _Helpiÿÿÿÿ(   t   Historyc         C  sa  t  r9 |  j } | d d d k r9 | j d d ƒ q9 n  t |  ƒ |  _ | d  k r€ t ƒ  } t | ƒ | j ƒ  t	 | ƒ } n  t
 j |  | d  d  ƒ t |  _ d |  _ t |  _ |  j } | j d d ƒ | j d |  j ƒ | j d	 |  j ƒ | j d
 |  j ƒ | j d |  j ƒ | j d |  j ƒ | j d |  j ƒ | j d |  j ƒ t  r~| j d |  j ƒ | j d |  j ƒ n  t j |  _ t j |  _  t j! |  _" d d l# m$ } t% |  d | j& ƒ |  _! t' |  d | j& ƒ |  _ t' |  d | j& ƒ |  _ t' |  d | j& ƒ |  _( t  s?|  j t _ |  j t _ |  j! t _! n  |  j) |  j ƒ |  _* d |  _+ d  S(   Ni   i    t   shellt   She_lli   t   wrapRb  s   <<newline-and-indent>>s   <<plain-newline-and-indent>>s   <<interrupt-execution>>s   <<end-of-file>>s   <<open-stack-viewer>>s   <<toggle-debugger>>s   <<toggle-jit-stack-viewer>>s   <<view-restart>>s   <<restart-shell>>iÿÿÿÿ(   R   Rž   RŸ   R    R¡   i2   (   R�  R‚  (,   Rt  t
   menu_specsRc   R²   R_   R   t   TkR   t   withdrawR“   R   R8   Rz   t   usetabst   indentwidtht   context_use_ps1R9   t	   configureR:   t   enter_callbackt   linefeed_callbackt   cancel_callbackt   eof_callbackRj  t   toggle_debuggert   toggle_jit_stack_viewert   view_restart_markt   restart_shellR¶   RŸ   t   save_stdoutR    t   save_stderrRž   t
   save_stdinR5  R   t   PseudoInputFileRS  t   PseudoOutputFileR¡   R€  t   historyR#  (   R5   R=   t   msRx   R9   R   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR8   p  sP    		

				c         C  s   t  j d t ƒ S(   Nt
   shell_only(   R   t   GetExtensionsRz   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   get_standard_extension_names¢  s    c         C  s
   | a  d  S(   N(   R    (   R5   t   stream(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   set_warning_stream¬  s    c         C  s   t  S(   N(   R    (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   get_warning_stream°  s    c         C  s`   |  j  r0 t j d d d |  j ƒ|  j ƒ  d S|  j j ƒ  } | rR |  j ƒ  n
 |  j ƒ  d  S(   Ns   Don't debug nows*   You can only toggle the debugger when idleRq   RO   (	   Rô   R{   R|   R9   t   set_debugger_indicatorR_   Rð   t   close_debuggert   open_debugger(   R5   Rg   t   db(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�  ³  s    		

c         C  s%   |  j  j ƒ  } |  j d | ƒ d  S(   Ns   <<toggle-debugger>>(   R_   Rð   t   setvar(   R5   R£  (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR   Á  s    c         C  s   d  S(   N(    (   R5   Rg   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�  Å  s    c         C  s�   |  j  j ƒ  } | r� |  j  j d  ƒ | j ƒ  |  j  j rQ t j |  j  j ƒ n  |  j ƒ  |  j	 j
 d ƒ d t _ |  j ƒ  n  |  j ƒ  d  S(   Ns   [DEBUG OFF]
s   >>> (   R_   Rð   R)  R   Rò   RÚ   R   t   close_remote_debuggerR  R¡   R!   R¶   t   ps1Rú   R   (   R5   R£  (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR¡  È  s    

	c         C  sq   |  j  j r' t j |  j  j |  ƒ } n t j |  ƒ } |  j  j | ƒ | j ƒ  d t _ |  j	 ƒ  |  j
 ƒ  d  S(   Ns   [DEBUG ON]
>>> (   R_   RÚ   R   t   start_remote_debuggerR   R)  Rü   R¶   R¦  Rú   R   (   R5   t   dbg_gui(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR¢  Õ  s    
	
c         C  s   |  j  ƒ  d |  _ d S(   s   Helper for ModifiedInterpreteri   N(   R  Rô   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRo  á  s    
c         C  s    d |  _  d |  _ |  j ƒ  d S(   s   Helper for ModifiedInterpreteri    N(   Rô   Ru  Rú   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR!  æ  s    		c         C  sf   |  j  r= t j d d d d d |  j ƒ} | t k r= d Sn  |  j ƒ  t |  _ t |  _ t	 j
 |  ƒ S(   s   Extend EditorWindow.close()s   Kill?s7   Your program is still running!
 Do you want to kill it?RÊ   Rf  Rq   t   cancel(   Rô   R{   t   askokcancelR9   Ry   Rõ   Rz   Ru  R  R   Rò   (   R5   R%  (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRò   ì  s    	
		c         C  s|   |  j  ƒ  t r  |  j j ƒ  n  |  j t _ |  j t _ |  j	 t _
 d |  _ d |  _ d |  j _ d |  _ t j |  ƒ d S(   sE   Extend EditorWindow._close(), shut down debugger and execution serverN(   R¡  Rt  R_   R  R“  R¶   RŸ   R”  R    R•  Rž   R   R¡   R=   R^   R˜  R   R�   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�   û  s    
			c         C  s   t  S(   s8   Override EditorWindow method: never remove the colorizer(   Rz   (   R5   R   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   ispythonsource  s    c         C  s   |  j  S(   N(   t   shell_title(   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   short_title  s    sH   Type "help", "copyright", "credits" or "license()" for more information.c         C  s˜   |  j  ƒ  t r< d } |  j j ƒ  } | sB |  j ƒ  t Sn d } |  j d t j t j	 |  j
 | f ƒ |  j j ƒ  |  j ƒ  d d  l } d  | _ t S(   NRP   s   ==== No Subprocess ====s   Python %s on %s
%s
%siÿÿÿÿ(   R  Rt  R_   Rì   Rò   Ry   R!   R¶   t   versionRÒ   t	   COPYRIGHTR9   t   focus_forceRú   t   TkinterR   t   _default_rootRz   (   R5   t   nosubt   clientR±  (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR—     s    

	
	c         C  s'   |  j  s d  St |  _ |  j j ƒ  d  S(   N(   t   readingRz   t   _stop_readline_flagR”   t   quit(   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRõ   '  s    		c         C  s  |  j  } z d |  _  |  j j ƒ  Wd  | |  _  X|  j rF t |  _ d S|  j j d d ƒ } t | ƒ d k rv d } n  t | t	 ƒ rÂ d d l
 m } y | j | j ƒ } WqÂ t k
 r¾ qÂ Xn  |  j ƒ  |  j rð d |  _ t sð t ‚ qð n  |  j rd |  _ d } n  | S(	   Ni   RP   R›   s   end-1ci    s   
iÿÿÿÿ(   R   (   Rµ  R”   t   mainloopR¶  Ry   R9   R\  R…   RQ  RR  R5  R   RT  RS  RU  R  Ru  Rt  R  t	   endoffile(   R5   R/   R   R   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   readline-  s4    		
			
					c         C  s   t  S(   N(   Rz   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   isattyJ  s    c         C  s×   y  |  j  j d d d ƒ r d  SWn n X|  j p9 |  j sd |  j ƒ  |  j j d ƒ |  j ƒ  d Sd |  _ d |  _	 |  j rº |  j j
 rº |  j j ƒ  rª |  j j ƒ  qº |  j j ƒ  n  |  j rÓ |  j j ƒ  n  d S(   Ns	   sel.firsts   !=s   sel.lasts   KeyboardInterrupt
RO   i    i   (   R9   R¨   Rô   Rµ  R  R_   R!   Rú   R¹  Ru  RÚ   Rð   Rÿ   R	  R”   R·  (   R5   Rg   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�  M  s&    

			c         C  sŽ   |  j  r |  j r d  S|  j j d d d ƒ oD |  j j d d d ƒ sK d  S|  j  sk |  j ƒ  |  j ƒ  n d |  _ d |  _ |  j j	 ƒ  d S(   NR›   s   ==Rc   s   end-1ci    i   RO   (
   Rô   Rµ  R9   R¨   R  Rò   Ru  R¹  R”   R·  (   R5   Rg   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRŽ  c  s    	
		c         C  s@   |  j  r/ |  j j d d ƒ |  j j d ƒ n |  j | ƒ d S(   NRc   s   
RO   (   Rµ  R9   Rc   R[  t   newline_and_indent_event(   R5   Rg   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRŒ  r  s
    	c         C  sù  |  j  r |  j r d  SyN |  j j d d ƒ } | rd |  j j d d d ƒ rd |  j | | ƒ d Sn  Wn n X|  j j d d d ƒ rË|  j j d	 d ƒ } | ré |  j j d d | d
 ƒ ré |  j |  j j | d | d
 ƒ | ƒ d S|  j j d	 d ƒ } | rK|  j j d d | d ƒ rK|  j |  j j | d | d
 ƒ | ƒ d S|  j j d d ƒ } | r¨|  j j | d d d ƒ r¨|  j |  j j | d
 d ƒ | ƒ n |  j |  j j d d ƒ | ƒ d S|  j j d d d ƒ rù|  j j d d ƒ n  |  j j d d ƒ } | r7| j	 ƒ  r7|  j j
 d d ƒ n  |  j j d d d ƒ r`|  j | ƒ d S|  j j d d ƒ |  j r¢|  j j d d ƒ |  j j d ƒ n |  j | ƒ |  j j d	 d d ƒ |  j j ƒ  |  j rë|  j j ƒ  n
 |  j ƒ  d S(   Ns	   sel.firsts   sel.lasts   <=R›   RO   Rc   R¦   s   iomark linestartRž   i   i    s   insert lineends   >=R¡   s   insert linestarts   end-1cs   end-1c linestarts   
(   Rô   Rµ  R9   R\  R¨   t   recallt   tag_prevranget   tag_nextrangeRø   R   R¬   R¼  Rc   R[  RZ   t   update_idletasksR”   R·  t   runit(   R5   Rg   t   selt   prevt   nextt   indicesR   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR‹  {  sX    "'"'&		
c         C  s«  t  j d d | ƒ } t  j d d | ƒ } | j d ƒ } |  j j ƒ  z@|  j j d d d ƒ |  j j d d	 ƒ |  j j d
 d ƒ } | j ƒ  j	 d ƒ rÁ |  j
 | ƒ |  j j d
 d ƒ } n  |  j j d | d j ƒ  ƒ t | ƒ d k r…t  j d | d ƒ j d ƒ } t  j d | ƒ j d ƒ } xX | d D]I } | j | ƒ ra| | t | ƒ } n  |  j j d d | j ƒ  ƒ q5Wn  Wd  |  j j d ƒ |  j j ƒ  Xd  S(   Ns   ^\s*\nRP   s   \n\s*$s   
RÂ  s   1.0RŽ   Rc   s   end-1cs   insert linestartt   :i    i   s	   ^([ \t]*)(   t   ret   subRX  R9   t   undo_block_startRi   Rø   R\  t   rstript   endswithR¼  Rc   R   R…   t   searcht   groupRt   R[  t   undo_block_stop(   R5   R   Rg   R   t   prefixt   orig_base_indentt   new_base_indentR   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR½  º  s*    (c         C  sÎ   |  j  j d d ƒ } t | ƒ } x. | d k rQ | | d d k rQ | d } q$ W| d k r | | d d k r | d } n  x. | d k r¯ | | d d k r¯ | d } q‚ W| |  } |  j j | ƒ d  S(   NR›   s   end-1ci    i   s    	s   
(   R9   R\  R…   R_   RV  (   R5   R   Rë   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRÁ  Ô  s    # #
c         C  so   |  j  j r |  j  j ƒ  Sy t j Wn! t j d d d |  j ƒd  SXd d l m	 } | |  j
 |  j ƒ d  S(   Ns   No stack traces@   There is no stack trace yet.
(sys.last_traceback is not defined)Rq   iÿÿÿÿ(   t   StackBrowser(   R_   RÚ   R  R¶   t   last_tracebackR{   R|   R9   t   idlelib.StackViewerRÒ  Rx   R=   (   R5   Rg   RÒ  (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRj  â  s    	
c         C  s$   |  j  j d ƒ |  j  j d ƒ d  S(   NR›   Rî   (   R9   R[  (   R5   Rg   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR‘  ð  s    c         C  s   |  j  j d t ƒ d S(   s&   Callback for Run/Restart Shell Cntl-F6RÖ   N(   R_   Rÿ   Rz   (   R5   Rg   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR’  ô  s    c         C  sk   |  j  ƒ  y t t j ƒ } Wn d } n X|  j j | ƒ |  j j d d ƒ |  j ƒ  |  j	 j
 ƒ  d  S(   NRP   Rc   s   end-1c(   R  Rv   R¶   R¦  R¡   R!   R9   Rø   t   set_line_and_columnRD   t
   reset_undo(   R5   R   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRú   ø  s    


c         C  sŒ   |  j  j d d ƒ } |  j r1 |  j j | ƒ n  |  j  j d ƒ d k r_ |  j  j d d ƒ n  |  j  j d d ƒ |  j ƒ  d t j _	 d  S(   NR›   s   end-1cs   end-2cs   
i    (
   R9   R\  R˜  t   storeRc   Rø   RÕ  R¶   RŸ   t	   softspace(   R5   RC  (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR    s    	
c         C  sr   y@ |  j  j d d ƒ t j |  | | d ƒ |  j  j d d ƒ Wn n X|  j rn d |  _ t sn t ‚ qn n  d  S(   NR›   t   rightRï   i    (   R9   Rù   R   R!   Ru  Rt  R  (   R5   R   R«   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR!     s    		c         C  sH   y  |  j  j d d d ƒ r d SWn t k
 r4 d SXt t |  ƒ j ƒ  S(   Ns	   sel.firstR¦   R›   t   disabled(   R9   R¨   R©   t   superR–   RJ   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRJ     s    c         C  s/   |  j  j d d d ƒ r d St t |  ƒ j ƒ  S(   NRc   R¦   R›   RÚ  (   R9   R¨   RÛ  R–   RN   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRN   !  s    (   R   Rv  (   Rw  Rx  (   Ra   Ry  (   Rz  R{  (   R|  R}  (   R~  R  N(    (5   R   R�   R   R¬  R˜   R	   R¥   R
   R„  t   idlelib.IdleHistoryR€  R   R8   Rœ  Ry   Rµ  Rô   Ru  R¹  R  R¶  Rž  RŸ  R�  R   R�  R¡  R¢  Ro  R!  Rò   R�   R«  R­  R¯  R—   Rõ   Rº  R»  R�  RŽ  RŒ  R‹  R½  RÁ  Rj  R‘  R’  Rú   R  R!   RJ   RN   (    (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR–   Z  sd   	2																				?				
	t
   PseudoFilec           B  s;   e  Z d d  „ Z e d „  ƒ Z e d „  ƒ Z d „  Z RS(   c         C  s(   | |  _  | |  _ d |  _ | |  _ d  S(   Ni    (   R�  R«   RØ  t	   _encoding(   R5   R�  R«   RS  (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR8   (  s    			c         C  s   |  j  S(   N(   RÞ  (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRS  .  s    c         C  s   d |  j  S(   Ns   <%s>(   R«   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   name2  s    c         C  s   t  S(   N(   Rz   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR»  6  s    N(   R   R�   R   R8   t   propertyRS  Rß  R»  (    (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRÝ  &  s   R—  c           B  s   e  Z d  „  Z d „  Z RS(   c         C  s   t  S(   N(   Rz   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   writable<  s    c         C  sÑ   |  j  r t d ƒ ‚ n  t | ƒ t t t f k r» t | t ƒ r] t j | t d  ƒ ƒ } q» t | t ƒ r~ t j
 | ƒ } q» t | t ƒ rŸ t j
 | ƒ } q» t d t | ƒ j ƒ ‚ n  |  j j | |  j ƒ S(   Ns   write to closed files   must be string, not (   t   closedR\   RË   RR  Rv   t	   bytearrayRQ  t   __getitem__t   sliceR   t   __str__t	   TypeErrorR   R�  R!   R«   (   R5   R   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR!   ?  s    	(   R   R�   Rá  R!   (    (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR—  :  s   	R–  c           B  s>   e  Z d d  „ Z d „  Z d d „ Z d d „ Z d „  Z RS(   c         C  s#   t  j |  | | | ƒ d |  _ d  S(   NRP   (   RÝ  R8   t   _line_buffer(   R5   R�  R«   RS  (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR8   Q  s    c         C  s   t  S(   N(   Rz   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   readableU  s    iÿÿÿÿc         C  s  |  j  r t d ƒ ‚ n  | d  k r- d } n1 t | t t f ƒ s^ t d t | ƒ j ƒ ‚ n  |  j	 } d |  _	 | d k  r¯ xƒ t
 r« |  j j ƒ  } | sž Pn  | | 7} q WnS x9 t | ƒ | k  rê |  j j ƒ  } | sÝ Pn  | | 7} q² W| | |  _	 | |  } | S(   Ns   read from closed fileiÿÿÿÿs   must be int, not RP   i    (   Râ  R\   R   RQ  Re   t   longRç  RË   R   Rè  Rz   R�  Rº  R…   (   R5   t   sizet   resultR   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRF  X  s,    					  
c         C  sÔ   |  j  r t d ƒ ‚ n  | d  k r- d } n1 t | t t f ƒ s^ t d t | ƒ j ƒ ‚ n  |  j	 ps |  j
 j ƒ  } | d k  r‘ t | ƒ } n  | j d d | ƒ } | d k r¿ | d } n  | | |  _	 | |  S(   Ns   read from closed fileiÿÿÿÿs   must be int, not i    s   
i   (   Râ  R\   R   RQ  Re   Rê  Rç  RË   R   Rè  R�  Rº  R…   t   find(   R5   Rë  R   t   eol(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRº  o  s    		c         C  s   |  j  j ƒ  d  S(   N(   R�  Rò   (   R5   (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRò     s    N(   R   R�   R   R8   Ré  RF  Rº  Rò   (    (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR–  O  s
   	c         C  sJ   |  j  d k rF x4 d D]) } |  j | d d |  j | d ƒ ƒ q Wn  d S(	   s6   Make paste replace selection on x11.  See issue #5124.t   x11t   Textt   Entryt   Spinboxs	   <<Paste>>s%   catch {%W delete sel.first sel.last}
N(   Rð  Rñ  Rò  (   t   _windowingsystemt
   bind_class(   Rx   t   cls(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   fix_x11_pasteƒ  s    s‡  
USAGE: idle  [-deins] [-t title] [file]*
       idle  [-dns] [-t title] (-c cmd | -r file) [arg]*
       idle  [-dns] [-t title] - [arg]*

  -h         print this help message and exit
  -n         run IDLE without a subprocess (see Help/IDLE Help for details)

The following options will override the IDLE 'settings' configuration:

  -e         open an edit window
  -i         open a shell window

The following options imply -i and will open a shell:

  -c cmd     run the command in a shell, or
  -r file    run script from file

  -d         enable the debugger
  -s         run $IDLESTARTUP or $PYTHONSTARTUP before anything else
  -t title   set title of shell window

A default edit window will be bypassed when -c, -r, or - are used.

[arg]* are passed to the command (-c) or script (-r) in sys.argv[1:].

Examples:

idle
        Open an edit window or shell depending on IDLE's configuration.

idle foo.py foobar.py
        Edit the files, also open a shell if configured to start with shell.

idle -est "Baz" foo.py
        Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell
        window with the title "Baz".

idle -c "import sys; print sys.argv" "foo"
        Open a shell window and run the command, passing "-c" in sys.argv[0]
        and "foo" in sys.argv[1].

idle -d -s -r foo.py "Hello World"
        Open a shell window, run a startup script, enable the debugger, and
        run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in
        sys.argv[1].

echo "import sys; print sys.argv" | idle - "foobar"
        Open a shell window, run the script piped in, passing '' in sys.argv[0]
        and "foobar" in sys.argv[1].
c          C  s#  t  t ƒ t a t }  t } t } d  } d  } t } y# t j t j d d ƒ \ } } Wn@ t j k
 r™ } t	 d | t
 f d t j ƒt j d ƒ n Xx;| D]3\ }	 }
 |	 d k rÈ |
 } t }  n  |	 d k rã t } t }  n  |	 d k rø t } n  |	 d	 k r!t j j t
 ƒ t j ƒ  n  |	 d
 k r6t }  n  |	 d k rKt a n  |	 d k r›|
 } t j j | ƒ rrn  t	 d | d t j ƒt j ƒ  t }  n  |	 d k r¶t } t }  n  |	 d k r¡ |
 t _ t }  q¡ q¡ W| r| d d k rt j j ƒ  } t }  n  x= t t t j ƒ ƒ D]& } t j j t j | ƒ t j | <qW| rs| d d k rsd g | d t _ nê | rŒd g | t _ nÑ | r¥| g | t _ n¸ | r,t } g  } x' | D] } | j t j j | ƒ ƒ q¾Wxy | D]= } t j j | ƒ } | t j k rèt j j d | ƒ qèqèWn1 t j ƒ  } | t j k r]t j j d | ƒ n  t j d d d d d ƒ} | p�| } |  pŽ| }  t d d ƒ a  t  j! ƒ  d d l" m# } | t  ƒ t j j$ t j j t% ƒ d ƒ } t& ƒ  d k rt j j$ | d ƒ } t  j' d | ƒ n¬ t( d  k rÈt j) d! k rÈt( d" k rId# n d$ } g  d4 D]% } t j j$ | d( | | f ƒ ^ qV} g  | D] } t* d | ƒ ^ qˆ} t  j+ j, d) d* t- t  ƒ d+ | Œ n  t. t  ƒ t/ t  ƒ t0 t  ƒ a1 t2 j3 t  t1 ƒ t2 j4 ƒ  r7t  j5 d, d- ƒ t  j5 d, d. ƒ t  j5 d, d/ ƒ n  | r™| pF| s™x4 | D]+ } t1 j6 | ƒ d  k rQ| j7 | ƒ qQqQW| s–t1 j8 ƒ  q–q™n  |  rÝt1 j9 ƒ  } | sµd  St2 j4 ƒ  ræt1 j: ræ| j; j< ƒ  qæn	 t1 j= } | rù| j> ƒ  n  | rQt j? j@ d0 ƒ p t j? j@ d1 ƒ } | rQt j j | ƒ rQ| jA jB | ƒ qQn  | s]| r¼| jA jC d2 t j f ƒ | r�| jA jD | ƒ qñ| rñ| jA jE | ƒ | jA jB | ƒ qñn5 | rñt2 jF t  ƒ } | rñ| jA jC d3 | ƒ qñn  x t1 jG r
t  jH ƒ  qôWt  jI ƒ  t  t ƒ d  S(5   Ni   s   c:deihnr:st:s   Error: %s
%sR   i   s   -cs   -ds   -es   -hs   -is   -ns   -rs   No script file: s   -ss   -ti    t   -RP   RÈ   RÉ   s   editor-on-startupRË   RÌ   t	   classNamet   Idleiÿÿÿÿ(   t   fix_scalingt   Iconst   Windowss   idle.icoRÊ   g      !@t   darwing333333!@s   .pngs   .gifi   i    i0   s	   idle_%d%st   wmt	   iconphotos   -defaultRð  s   <B2>s   <B2-Motion>s   <<PasteSelection>>t   IDLESTARTUPt   PYTHONSTARTUPsb   if 1:
            import sys as _sys
            _sys.argv = %r
            del _sys
            
s   print('%s')(   i   i    i0   (J   R)   Rz   Rt  Ry   R   t   getoptR¶   t   argvRÜ   R  t	   usage_msgR    t   exitRŸ   R!   R?   R@   Rƒ   R–   R¬  Rž   RF  RŒ   R…   t   abspathR]   t   dirnameRc   t   getcwdR   RÑ   R…  Rx   R†  t   idlelib.runRú  RA   t   __file__R   t   wm_iconbitmapt	   TkVersionRÒ   t
   PhotoImaget   tkt   callRv   R   Rö  R“   R=   R   t   setupAppt   isAquaTkt   unbind_classRr   Rh   t   newR>   t   dictR”   t   lowerR^   R¢  t   environR\  R_   RB  R  RD  RY  t   tkVersionWarningt   inversedictR¸  t   destroy(   t   enable_shellt   enable_editRa   t   cmdt   scriptt   startupt   optsRH   R_  t   ot   aRë   t   pathxR   t   dirt
   edit_startRú  t   icondirt   iconfilet   extRë  t	   iconfilest   iconsR�  t   tkversionwarning(    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRÈ   Ã  s    
#					
				$

!/"%

		
R³   (N   t
   __future__R    R?   t   os.pathR¶   R�   R  RÇ  RÛ   RØ   R  RD   R   RK  R   RÒ   R   R   R±  t   ImportErrorR  R   R  R{   t   idlelib.EditorWindowR   R   t   idlelib.FileListR   t   idlelib.ColorDelegatorR	   t   idlelib.UndoDelegatorR
   t   idlelib.OutputWindowR   t   idlelib.configHandlerR   R5  R   R   R   R   R   t   ascii_letterst   digitsR]  R×   R¼   t   signalR   R    R&   R   R   R$   R%   R)   Rz   t
   checkcacheR1   R2   R“   R˜   R¥   t	   RPCClientR¯   R²   R–   t
   TextIOBaseRÝ  R—  R–  Rö  R  RÈ   R   R·   Ry   (    (    (    s4   /opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt   <module>   s†   	

		
	»ÿ ×ÿ Í4	>	¤
