
?`c           @   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 l
 Z
 d  d l Z d  d l Z d  d l m Z d  d l m Z y d  d l TWn+ e k
 r e j d IJe 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 l. m/ Z/ Wn e k
 rd Z/ n Xe j a0 y d  d l1 Z1 Wn e k
 r4n. Xe2 e2 d  Z3 e3 e1 _4 e2 d  Z5 e5 e1 _6 e2 e j7 d  Z8 e8 e _7 d e f d     YZ9 d e f d     YZ: d e f d     YZ; d  e f d!     YZ< d" e% j= f d#     YZ> d$ e f d%     YZ? d& e  f d'     YZ@ d( e jA f d)     YZB d* eB f d+     YZC d, eB f d-     YZD d. ZE d/   ZF eG d0 k re jH d0 e jH d& <eF   n  d S(1   iN(   t   InteractiveInterpreter(   t   python_version(   t   *sK   ** IDLE can't import Tkinter.  Your Python may not be configured for Tk. **i   (   t   EditorWindowt   fixwordbreaks(   t   FileList(   t   ColorDelegator(   t   UndoDelegator(   t   OutputWindow(   t   idleConf(   t   idlever(   t   rpc(   t   Debugger(   t   RemoteDebugger(   t   macosxSupportt   _s	   127.0.0.1i    (   t   SIGTERMi   c         C   sV   | d  k r t } n  y) | j t j |  | | | d |  Wn t k
 rQ n Xd  S(   Nt   line(   t   Nonet   warning_streamt   writet   warningst   formatwarningt   IOError(   t   messaget   categoryt   filenamet   linenot   fileR   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   idle_showwarning<   s    	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 ways!   
Warning (from warnings module):
s     File "%s", line %s
s       %s
s   %s: %s
>>> N(   R   t	   linecachet   getlinet   stript   __name__(   R   R   R   R   R   t   s(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   idle_formatwarningF   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   is   <>N(   R   t   cachet   listt   popt   update(   R   t   orig_checkcacheR$   t   savet   key(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   extended_linecache_checkcacheS   s    	
t   PyShellEditorWindowc           B   s   e  Z d  Z d   Z d d d d d g 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  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(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   filename_changed_hookw   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   R-   (   R/   t   argsR0   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR2   m   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   s   |  j  } |  j j } | j d d | d | d  y |  j j |  } Wn! t k
 rm |  j j |  n Xy& |  j j	 j
 j } | j | |  Wn n Xd  S(   Nt   BREAKs   %d.0i   (   R3   R>   R   t   tag_addR1   t   indext
   ValueErrort   appendR7   t   pyshellt   interpt   debuggerR5   (   R/   R   R3   R   t   it   debug(    (    s'   /usr/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(   R3   R>   R   t   bellt   intt   floatRJ   RR   (   R/   t   eventR3   R   R   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR5      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(   NRS   RH   s   insert linestarts   insert lineend +1char(   R3   R>   R   RT   RU   RV   RJ   R1   t   removet
   tag_removeR7   RM   RN   RO   R6   (   R/   RW   R3   R   R   RQ   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR6      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(   NRH   s   1.0(   R1   R3   R>   R   RT   RY   t   ENDR7   RM   RN   RO   t   clear_file_breaks(   R/   R3   R   RQ   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR[      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(   R1   R>   R   t   openR=   t	   readlinesR   t
   startswithR   t   update_breakpointst   strt   getattrt   roott   Falset   TrueR_   t   tkMessageBoxt	   showerrorR3   (   R/   t   breaksR   t   old_filet   linest   new_fileR   t   err(    (    s'   /usr/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(   NR\   R^   i   (   R3   R'   R>   R   R   R9   R:   t   isfileR=   Rb   Rc   Rd   t   evalt   lenRR   (   R/   R   Ro   R   t   breakpoint_linenumberst   breakpoint_linenumber(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR-      s    c         C   s4   |  j  } | j d  } |  j |  } | |  _ d S(   s3   Retrieves all the breakpoints in the current windowRH   N(   R3   t
   tag_rangest   ranges_to_linenumbersR1   (   R/   R3   t   rangest   linenumber_list(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyRe      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   rangeRu   RU   RV   t   stringRL   (   R/   Rz   Ro   RJ   R   t   end(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyRy     s    c         C   s   |  j    t j |   d S(   s7   Extend base method - clear breaks when module is closedN(   R[   R   t   _close(   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR     s    
(   RB   s   <<cut>>s   rmenu_check_cut(   RD   s   <<copy>>RE   (   RF   s	   <<paste>>s   rmenu_check_pasteN(   s   Set Breakpoints   <<set-breakpoint-here>>N(   s   Clear Breakpoints   <<clear-breakpoint-here>>N(   R!   t
   __module__t   __doc__R2   R   t   rmenu_specsRR   R5   R6   R[   Rr   R-   Re   Ry   R   (    (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR,   j   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(   RM   t   topt   wakeupt   PyShellt   beginR   (   R/   RW   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR8   &  s    		N(   R!   R   R   R,   R   R   RM   R8   (    (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR     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   R2   t   LoadTagDefs(   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR2   4  s    c         C   s7   |  j  d d d  |  j d d d  t j |   d  S(   Nt   TODOs   1.0t   iomarkt   SYNC(   RY   RI   R   t   recolorize_main(   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR   8  s    c         C   s   t  j |   t j d d d  } |  j j i i d  d 6d  d 6d 6t j | d  d 6t j | d  d 6t j | d	  d	 6 d  S(
   Nt   maint   Themet   namet
   backgroundt
   foregroundt   stdint   stdoutt   stderrt   console(   R   R   R	   t	   GetOptiont   tagdefsR'   R   t   GetHighlight(   R/   t   theme(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR   =  s    c         C   s+   x$ |  j  D] } |  j | d d  q
 Wd  S(   NR   R~   (   R   RY   (   R/   t   tag(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   removecolorsG  s    (   R!   R   R   R2   R   R   R   (    (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR   1  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   compareRT   t   TclErrorR   RS   (   R/   RJ   t   charst   tags(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyRS   O  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   RT   R   R   t   delete(   R/   t   index1t   index2(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR   X  s    N(   R!   R   R   R   RS   R   (    (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR   L  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(   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt
   handle_EOFd  s    (   R!   R   R   (    (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR   b  s   t   ModifiedInterpreterc           B   s@  e  Z d    Z d Z d Z d   Z d   Z d   Z e	 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    R2   R   t   save_warnings_filtersRi   t
   restartingt   subprocess_arglistt   PORTt   portt   compilet   compilert   flagst   original_compiler_flags(   R/   R   R   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR2   k  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_arglistR9   t   spawnvt   P_NOWAITR   t
   executablet   rpcpid(   R/   RA   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   spawn_subprocessx  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   -QnewR   t   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   warnoptionsRL   R	   R   Ri   R!   t   platformR   Rf   (   R/   R"   R]   t	   del_exitft   commandt   decorated_exec(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR   ~  s    	 "	c         C   s  t  |  j f } x\ t d  D]@ } t j |  y t |  |  _ PWq t j k
 r[ } 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   R7   R   RN   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   R7   R   t   transfer_pathRj   t   poll_subprocess(   R/   t   addrRP   Rq   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   start_subprocess  s>    



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  | r
| j d  | j   n  t | j  d d d } | j | d |  | j j d	 d  | j j d	 d
  | j   | rt j |  j  } | j   n  |  j |  j j _  t
 |  _  |  j S(   NR   R   s   end-1cs   
i   i   R^   s	    RESTART t   restartt   left(!   R   R   Rj   t   getdebuggerR   t   close_subprocess_debuggert   closet   unix_terminateR   t	   executingRi   R   R   R   R   R   R   R   t   stop_readlineR3   R   R   t
   showpromptRU   t   widtht   mark_sett   mark_gravityt   restart_subprocess_debuggert   load_breakpointsR   R   R   R   (   R/   R   RQ   R   t   was_executingRq   t   halfbart   gui(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   restart_subprocess  sJ    		
			



	c         C   s   |  j  j d d d i   d  S(   Nt   exect   interrupt_the_server(    (   R   t
   remotecall(   R/   (    (    s'   /usr/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(   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   interrupt_subprocess  s    c         C   sH   y |  j  j   Wn t k
 r$ n X|  j   t |  j _ d  |  _  d  S(   N(   R   R   t   AttributeErrorR   Ri   R   R   R   (   R/   (    (    s'   /usr/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   hasattrR9   R   R   R   t   OSErrort   waitpid(   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR     s    c         C   sC   | r" d g } | j  t j  n	 t j } |  j d | f  d  S(   Nt    sR   if 1:
        import sys as _sys
        _sys.path = %r
        del _sys
        
(   t   extendR   R:   t
   runcommand(   R/   R   R:   (    (    s'   /usr/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| rb|  j j
   d  |  _ | \ } } |  j j } | d k r | d  k	 r:| t |  IJq:nf | d k r|  j j d  r:|  j   q:n8 | d k r:d } t j | I| IJ| | I| IJn  y |  j j   Wqbt k
 r^qbXn  |  j j s|  j j j |  j j |  j  n  d  S(   Nt   waitg?t   OKt	   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   reprt   getvart   remote_stack_viewerR   t
   __stderr__t   endexecutingR   R3   t   aftert   pollintervalR   (   R/   t   cltt   responset   howt   whatR   t   errmsg(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR     s@    		c         C   s   | |  _  d  S(   N(   RO   (   R/   RO   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   setdebuggerA  s    c         C   s   |  j  S(   N(   RO   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR   D  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   R3   R  R  (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   open_remote_stack_viewerG  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 d d d	  } t j | d
  d } | | d | d d }	 |	 j j d d d d  | |	 j d  |  }
 |
 j   d  S(   Ni(   t   RemoteObjectBrowserR   t   stackviewerR7   (   t   ScrolledCanvast   TreeNodeR   R   R   t   normalR   t   bgt   highlightthicknessi    t   expandi   t   fillt   both(   s   flist(   t   idlelibR  R   t   remotequeueR   R   Rh   RT   t   StubObjectTreeItemt   idlelib.TreeWidgetR   R!  t   ToplevelR	   R   R   t   framet   packt   canvasR%  (   R/   R  t   oidt   itemR   R!  R   R   R   t   sct   node(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR  T  s    i    c         C   s#   |  j  |  } |  j | |  d S(   s1   Like runsource() but assumes complete exec sourceN(   t   stuffsourcet   execfile(   R/   t   sourceR   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt
   execsourceg  s    c         C   s   | d k r$ t | d  j   } n  y t | | d  } Wna t t f k
 r |  j j   |  j j } | d IJ| d IJt	 j
 |  |  |  j j   n X|  j |  d S(   s   Execute an existing fileR\   R   s    *** Error in script or command!
s"   Traceback (most recent call last):N(   R   Rb   t   readR   t   OverflowErrort   SyntaxErrorR   R  R   R    t   showsyntaxerrorR   t   runcode(   R/   R   R6  t   codet   tkerr(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR5  l  s    

c         C   s   |  j  |  } d |  _ t j |  _ t j d d d t  t | t j	  r d d l
 m } y | j | j  } 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   i(   t	   IOBindings    Unsupported characters in input
N(   R4  t   moreR   t   filtersR   t   filterwarningst   SyntaxWarningt
   isinstancet   typest   UnicodeTypeR(  R@  t   encodet   encodingt   UnicodeErrorR   R  R   R    t	   runsourceR   (   R/   R6  R   R@  (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyRK  |  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   splitRu   R   R$   (   R/   R6  R   Ro   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR4    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  (   R/   R   (    (    s'   /usr/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   R3   t   unpackerrorRI   t   seet   gett
   IDENTCHARSR  R   Rf   R    R;  R   (
   R/   R   R3   t   stufft   msgR   t   offsetR   t   post   char(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR;    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_infoR:  R   (
   R/   R   t   valuet   tbt   okRT  t   dummy_filenameR   RU  R   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyRO    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(   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR^    s
    
c         C   sF   t  j } x6 | j   D]( } | d  | d d k r | | =q q Wd  S(   Ni   is   <>(   R   R$   t   keys(   R/   t   cR*   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR]    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   R<  i   (   R   R   t   display_executing_dialogR   R)  R   (   R/   R=  (    (    s'   /usr/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	 } z;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  nl e rX|  j  j d IJ|  j   |  j  j   q|  j  j re |  j  _ |  j  j d	 IJq|  j   n XWd
 e sy |  j  j   Wqe k
 rqXn  Xd
 S(   s   Override base class methodR   R<  s   Exit?s   Do you want to exit altogether?R   t   yest   masters    IDLE internal error in runcode()R  N(   R   R   RN   R   R]  R   R   R   RB  RO   t   beginexecutingR   t
   asyncqueueR  t   runR   t
   SystemExitR  Rk   t   askyesnoR3   R^  t   use_subprocessR   R  t   canceledRi   R   (   R/   R=  RO   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR<    sR    
	 

c         C   s   |  j  j j |  d S(   s   Override base class methodN(   R   R   R   (   R/   R"   (    (    s'   /usr/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.Rd  (   Rk   Rl   R   R3   (   R/   (    (    s'   /usr/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.Rd  (   Rk   Rl   R   R3   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR   ,  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.Rd  (   Rk   Rl   R   R3   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyRb  4  s    N('   R!   R   R2   R   R   R   R   R   R   Ri   R   R   R   R   R   R   R  R   RO   R  R   R  R  RL  R7  R5  RK  R4  RN  R;  RO  R^  R]  R  R<  R   R   R   Rb  (    (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR   i  sF   	
			+.						&													1			R   c           B   s  e  Z d  e   d Z e Z e Z d6 d7 d8 d9 d: d; g Z e	 j
   r[ e d =d< e d <n  d d l m Z d= d  Z d   Z e Z e Z e Z e Z e Z e Z 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= d(  Z* d)   Z+ d*   Z, d+   Z- d,   Z. d-   Z/ d= d.  Z0 d= d/  Z1 d= d0  Z2 d1   Z3 d2   Z4 d> d3  Z5 d4   Z6 d5   Z7 RS(?   s   Python s    ShellR   t   _Filet   editt   _EditRQ   t   _Debugt   optionst   _Optionst   windowst   _Windowst   helpt   _Helpit   _Windowii(   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   wrapRW  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   (   s   shellRy  (,   Rj  t
   menu_specsRS   R   RN   R   t   TkR   t   withdrawR   R   R2   Rj   t   usetabst   indentwidtht   context_use_ps1R3   t	   configureR4   t   enter_callbackt   linefeed_callbackt   cancel_callbackt   eof_callbackR_  t   toggle_debuggert   toggle_jit_stack_viewert   view_restart_markt   restart_shellR   R   t   save_stdoutR   t   save_stderrR   t
   save_stdinR(  R@  t   PseudoInputFileRI  t   PseudoOutputFileR   Rw  t   historyR  (   R/   R7   t   msRh   R3   R@  (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR2   V  sP    		

				c         C   s   t  j d t  S(   Nt
   shell_only(   R	   t   GetExtensionsRj   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   get_standard_extension_names  s    c         C   s
   | a  d  S(   N(   R   (   R/   t   stream(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   set_warning_stream  s    c         C   s   t  S(   N(   R   (   R/   (    (    s'   /usr/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 idleRd  t   break(	   R   Rk   Rl   R3   t   set_debugger_indicatorRN   R   t   close_debuggert   open_debugger(   R/   RW   t   db(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR    s    		

c         C   s%   |  j  j   } |  j d |  d  S(   Ns   <<toggle-debugger>>(   RN   R   t   setvar(   R/   R  (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR    s    c         C   s   d  S(   N(    (   R/   RW   (    (    s'   /usr/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   >>> (   RN   R   R  R   R   R   R   t   close_remote_debuggerR  R   R   R   t   ps1R   R  (   R/   R  (    (    s'   /usr/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]
>>> (   RN   R   R   t   start_remote_debuggerR   R  R   R   R  R   R  (   R/   t   dbg_gui(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR    s    
	
c         C   s   |  j    d |  _ d S(   s   Helper for ModifiedInterpreteri   N(   R  R   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyRe    s    
c         C   s    d |  _  d |  _ |  j   d S(   s   Helper for ModifiedInterpreteri    N(   R   Rk  R   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR    s    		c         C   sz   |  j  r= t j d d d d d |  j } | t k r= d Sn  |  j   t |  _ t |  _ |  j j	 d |  j
 |  j  d S(	   s   Extend EditorWindow.close()s   Kill?s6   The program is still running!
 Do you want to kill it?R   R[  Ra   t   canceli   N(   R   Rk   t   askokcancelR3   Ri   R   Rj   Rk  R  R  R  t   close2(   R/   R  (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR     s    	
		c         C   s   t  j |   S(   N(   R   R   (   R/   (    (    s'   /usr/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  Rj  RN   R   R  R   R   R  R   R  R   R   R   R7   RM   R  R   R   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR     s    
			c         C   s   t  S(   s8   Override EditorWindow method: never remove the colorizer(   Rj   (   R/   R   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   ispythonsource  s    c         C   s   |  j  S(   N(   t   shell_title(   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   short_title  s    s@   Type "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   d d  l } d  | _ t S(   NR  s   ==== No Subprocess ====s   Python %s on %s
%s
%si(   R  Rj  RN   R   R   Ri   R   R   t   versionR   t	   COPYRIGHTR   t   TkinterR   t   _default_rootRj   (   R/   t   nosubt   clientR  (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR     s    

	
	c         C   s'   |  j  s d  St |  _ |  j j   d  S(   N(   t   readingRj   t   _stop_readline_flagR   t   quit(   R/   (    (    s'   /usr/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   R  R   s   end-1ci    s   
i(   R@  (   R  R   t   mainloopR  Ri   R3   RQ  Ru   RE  t   unicodeR(  R@  RH  RI  RJ  R  Rk  Rj  R  t	   endoffile(   R/   R)   R   R@  (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   readline  s4    		
			
					c         C   s   t  S(   N(   Rj   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   isatty3  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
R  i    i   (   R3   R   R   R  R  RN   R   R   R  Rk  R   R   R   R   R   R  (   R/   RW   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR  6  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   ==RS   s   end-1ci    i   R  (
   R   R  R3   R   R  R   Rk  R  R   R  (   R/   RW   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR  L  s    	
		c         C   s@   |  j  r/ |  j j d d  |  j j d  n |  j |  d S(   NRS   s   
R  (   R  R3   RS   RP  t   newline_and_indent_event(   R/   RW   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR  [  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   R  RS   R   s   iomark linestartR   i   i    s   insert lineends   >=R   s   insert linestarts   end-1cs   end-1c linestarts   
(   R   R  R3   RQ  R   t   recallt   tag_prevranget   tag_nextrangeR   R    R   R  RS   RP  RI   t   update_idletasksR   R  t   runit(   R/   RW   t   selt   prevt   nextt   indicesR"   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR  d  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*\nR  s   \n\s*$s   
R  s   1.0R~   RS   s   end-1cs   insert linestartt   :i    i   s	   ^([ \t]*)(   t   ret   subRM  R3   t   undo_block_startRY   R   RQ  t   rstript   endswithR  RS   R    Ru   t   searcht   groupRd   RP  t   undo_block_stop(   R/   R"   RW   Ro   t   prefixt   orig_base_indentt   new_base_indentR   (    (    s'   /usr/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   
(   R3   RQ  Ru   RN   RK  (   R/   R   RP   RA  (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR    s    # #
c         C   sq   |  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)Rd  i(   t   StackBrowser(   RN   R   R  R   t   last_tracebackRk   Rl   R3   t   idlelib.StackViewerR  Rh   R7   (   R/   RW   R  t   sv(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR_    s    	
c         C   s$   |  j  j d  |  j  j d  d  S(   NR   R   (   R3   RP  (   R/   RW   (    (    s'   /usr/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(   RN   R   Rj   (   R/   RW   (    (    s'   /usr/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(   NR  RS   s   end-1c(   R  Rf   R   R  R   R   R3   R   t   set_line_and_columnR>   t
   reset_undo(   R/   R"   (    (    s'   /usr/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    (
   R3   RQ  R  t   history_storeRS   R   R  R   R   t	   softspace(   R/   R6  (    (    s'   /usr/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    (   R3   R   R   R   Rk  Rj  R  (   R/   R"   R   (    (    s'   /usr/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(   R3   R   R   t   superR   RC   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyRC     s    c         C   s/   |  j  j d d d  r d St t |   j   S(   NRS   R   R   R  (   R3   R   R  R   RG   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyRG   
  s    (   s   fileRl  (   Rm  Rn  (   s   debugRo  (   Rp  Rq  (   Rr  Rs  (   s   helpRu  (   Rr  Rv  N(    (8   R!   R   R   R  R   R   R   R   R{  R   t   runningAsOSXAppt   idlelib.IdleHistoryRw  R   R2   R  Ri   R  R   Rk  R  R  R  R  R  R  R  R  R  R  Re  R  R   R  R   R  R  R  R   R   R  R  R  R  R  R  R  R  R_  R  R  R   R  R   RC   RG   (    (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR   <  sl   	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    (   Rx  R   R  t	   _encoding(   R/   Rx  R   RI  (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR2     s    			c         C   s   |  j  S(   N(   R  (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyRI    s    c         C   s   d |  j  S(   Ns   <%s>(   R   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR     s    c         C   s   t  S(   N(   Rj   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR    s    N(   R!   R   R   R2   t   propertyRI  R   R  (    (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR    s   R  c           B   s   e  Z d    Z d   Z RS(   c         C   s   t  S(   N(   Rj   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   writable%  s    c         C   s_   |  j  r t d   n  t | t t f  sI t d t |  j   n  |  j j	 | |  j
  S(   Ns   write to closed files   must be string, not (   t   closedRK   RE  t
   basestringt	   bytearrayt	   TypeErrorR   R!   Rx  R   R   (   R/   R"   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR   (  s
    	(   R!   R   R  R   (    (    (    s'   /usr/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(   NR  (   R  R2   t   _line_buffer(   R/   Rx  R   RI  (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR2   2  s    c         C   s   t  S(   N(   Rj   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   readable6  s    ic         C   s   |  j  r t d   n  | d  k r- d } n+ t | t  sX t d t |  j   n  |  j } d |  _ | d k  r x t	 r |  j
 j   } | s Pn  | | 7} qy WnS x9 t |  | k  r |  j
 j   } | s Pn  | | 7} q W| | |  _ | |  } | S(   Ns   read from closed fileis   must be int, not R  i    (   R  RK   R   RE  RU   R  R   R!   R  Rj   Rx  R  Ru   (   R/   t   sizet   resultR   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR8  9  s,    					  
c         C   s   |  j  r t d   n  | d  k r- d } n+ t | t  sX t d t |  j   n  |  j pm |  j	 j
   } | d k  r t |  } n  | | |  _ | |  S(   Ns   read from closed fileis   must be int, not i    (   R  RK   R   RE  RU   R  R   R!   R  Rx  R  Ru   (   R/   R  R   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR  P  s    		c         C   s   |  j  j   d  S(   N(   Rx  R   (   R/   (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR   ]  s    N(   R!   R   R   R2   R  R8  R  R   (    (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR  0  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  a t }  t } t } d  } d  } t } y# t j t j d d  \ } } WnM t j k
 r } t j j	 d t
 |   t j j	 t  t j d  n Xx.| D]&\ }	 }
 |	 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 r9t  }  n  |	 d
 k rNt a n  |	 d k r|
 } t j j |  run d G| GHt 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| ri| d d k ri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 rSt j j d |  n  t j d d d d d } | pw| } |  p| }  t d d  a t  t  t j!   t" t  a# t$ j% t t#  | r(| p| s(x4 | D]+ } t# j& |  d  k r| j' |  qqW| s%t# j(   q%q(n  |  rlt# j)   } | sDd  St$ j*   rlt# j+ rl| j, j-   qln  t# j. } | r| j/   n  | rt j0 j1 d  pt j0 j1 d  } | rt j j |  r| j2 j3 |  qn  | r| s| rQ| j2 j4 d t j f  | r%| j2 j5 |  qQ| rQ| j2 j6 |  | j2 j3 |  qQn  t$ j7 t  } | r| j2 j4 d j8 d | d f   n  x t# j9 rt j:   qWt j;   d  S(   Ni   s   c:deihnr:st:s
   Error: %s
i   s   -cs   -ds   -es   -hs   -is   -ns   -rs   No script file: s   -ss   -ti    t   -R  R   R   s   editor-on-startupR   R   t	   classNamet   Idlet   IDLESTARTUPt   PYTHONSTARTUPsb   if 1:
            import sys as _sys
            _sys.argv = %r
            del _sys
            
s   print('s   ')(<   Rj   Rj  Ri   R   t   getoptR   t   argvR   R   R   Rf   t	   usage_msgt   exitR   R9   R:   Rs   R   R  R   R8  R|   Ru   t   abspathRL   t   dirnameRS   t   getcwdR	   R   R|  Rh   R   R}  R   R7   R   t   setupAppRb   RX   t   newR8   R  t   dictR   t   lowerRM   R  t   environRQ  RN   R5  R  R7  RN  t   tkVersionWarningR;   t   inversedictR  t   destroy(   t   enable_shellt   enable_editRQ   t   cmdt   scriptt   startupt   optsRA   RT  t   ot   aRP   t   pathxR   t   dirt
   edit_startRx  t   tkversionwarning(    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyR     s    #						
				$

		%R   (I   R9   t   os.pathR   R}   R  R  R   R   R   t	   tracebackRF  R>   R   R=  R    R   R   R  t   ImportErrorR  R  Rk   t   idlelib.EditorWindowR   R   t   idlelib.FileListR   t   idlelib.ColorDelegatorR   t   idlelib.UndoDelegatorR   t   idlelib.OutputWindowR   t   idlelib.configHandlerR	   R(  R
   R   R   R   R   t   ascii_letterst   digitsRR  R   R   t   signalR   R   R   R   R   t   showwarningR#   R   t
   checkcacheR+   R,   R   R   R   t	   RPCClientR   R   R   t
   TextIOBaseR  R  R  R  R   R!   R   (    (    (    s'   /usr/lib64/python2.7/idlelib/PyShell.pyt   <module>   s   
				  d	