
    <h0                        S r SSKrSSKrSSKrSSKrSSKJr  SSKJrJ	r	  SSK
Jr  SSK
Jr  SSKJr  SSKJr  SS	KJr  SS
KJr  SSKJrJrJrJr  SSKJr  SSKJrJr  SSKJ r J!r!J"r"  SSK#J$r$  SSK%J&r&  SSK'J(r(  SSK)J*r*J+r+J,r,J-r-J.r.  Sr/ " S S\5      r0\1" \5      r2\2Rg                  \!5        0 r4S r5\5" SSSS5        \5" SSSS5        \5" S S!S"S#5        \5" S$S%S&S'5        \5" S(S)S*S+5        \5" S,S-S.S/5        \" 5       r6S\6Rn                  l8        S0\6R$                  l9        S1\6RL                  l:        S2\6Rn                  l;        S2\6Rn                  l<        S2\6Rn                  l=        S3\6Rn                  l>        S4\6Rn                  l?        \6S54\4S6'   S7S8S900S:4\4S8'   S7S;S900S<4\4S='   \2Rg                  \45        \1" \5      r@\@Rg                  \"5         " S> S?\5      rA " S@ S7\\ 5      rBSBSA jrC\BR                  rEg)Czp
The :class:`~traitlets.config.application.Application` object for the command
line :command:`ipython` program.
    N)Config)boolean_flagcatch_config_error)release)usage)IPCompleter)CrashHandler)PlainTextFormatter)HistoryManager)
ProfileDirBaseIPythonApplication
base_flagsbase_aliases)MagicsManager)ScriptMagicsLoggingMagics)InteractiveShellAppshell_flagsshell_aliases)StoreMagics   )TerminalInteractiveShell)get_ipython_dir)BoolListdefaultobserveTypea  
ipython --matplotlib       # enable matplotlib integration
ipython --matplotlib=qt    # enable matplotlib integration with qt4 backend

ipython --log-level=DEBUG  # set logging to DEBUG
ipython --profile=foo      # start with profile foo

ipython profile create foo # create profile foo w/ default config files
ipython help profile       # show the help for the profile subcmd

ipython locate             # print the path to the IPython directory
ipython locate profile foo # print the path to the directory for profile `foo`
c                   8   ^  \ rS rSrSrU 4S jrU 4S jrSrU =r$ )IPAppCrashHandler?   zDsys.excepthook for IPython itself, leaves a detailed report on disk.c                 r   > [         R                  n[         R                  nSn[        [        U ]  XX45        g )Nz)https://github.com/ipython/ipython/issues)r   authorauthor_emailsuperr    __init__)selfappcontact_namecontact_emailbug_tracker	__class__s        iC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\IPython/terminal/ipapp.pyr&   IPAppCrashHandler.__init__B   s1    ~~,,A.}	
    c                 j  > U R                   n[        [        U ]  U5      /nUR                  n U" US-   5        U R
                  R                  R                  S    H  nU" U5        M     U" S5        U" U R
                  R                  R                  S-   5        SR                  U5      $ !    N= f)z*Return a string containing a crash report.zHistory of session input:_ihz7
*** Last line of input (may not be in above history):

 )
section_sepr%   r    make_reportappendr(   shelluser_ns_last_input_linejoin)r'   	tracebacksec_sepreportrpt_addliner,   s         r-   r5   IPAppCrashHandler.make_reportJ   s     "")4<YGH--	G778..u5 6OPDHHNN33D89 wwv	s   A.B. .B2 )	__name__
__module____qualname____firstlineno____doc__r&   r5   __static_attributes____classcell__r,   s   @r-   r    r    ?   s    N
 r/   r    c                  8    [         R                  [        U 6 5      $ N)frontend_flagsupdater   )argss    r-   <lambda>rO   c   s    --lD.ABr/   zautoedit-syntaxz(TerminalInteractiveShell.autoedit_syntaxz1Turn on auto editing of files with syntax errors.z2Turn off auto editing of files with syntax errors.zsimple-promptz&TerminalInteractiveShell.simple_promptz-Force simple minimal prompt using `raw_input`z1Use a rich interactive prompt with prompt_toolkitbannerz!TerminalIPythonApp.display_bannerz'Display a banner upon starting IPython.z-Don't display a banner upon starting IPython.zconfirm-exitz%TerminalInteractiveShell.confirm_exitzSet to confirm when you try to exit IPython with an EOF (Control-D
    in Unix, Control-Z/Enter in Windows). By typing 'exit' or 'quit',
    you can force a direct exit without any confirmation.z#Don't prompt the user when exiting.tipz#TerminalInteractiveShell.enable_tipz Shows a tip when IPython starts.z#Don't show tip when IPython starts.z
term-titlez#TerminalInteractiveShell.term_titlez'Enable auto setting the terminal title.z(Disable auto setting the terminal title.Fz'IPython.terminal.prompts.ClassicPromptsr3   nocolorPlainz:Gives IPython a similar feel to the classic Python prompt.classicTerminalIPythonAppquickTz*Enable quick startup with no config files.force_interactzIf running code from the command line, become interactive afterwards.
    It is often useful to follow this with `--` to treat remaining flags as
    script arguments.
    ic                   *    \ rS rSrSr\" SS9rS rSrg)LocateIPythonApp   z!print the path to the IPython dir)z%IPython.core.profileapp.ProfileLocatez.print the path to an IPython profile directory)profilec                 |    U R                   b  U R                   R                  5       $ [        U R                  5        g rK   )subappstartprintipython_dirr'   s    r-   r_   LocateIPythonApp.start   s-    ;;";;$$&&$""#r/   rA   N)	rB   rC   rD   rE   descriptiondictsubcommandsr_   rG   rA   r/   r-   rZ   rZ      s    9K
K
$r/   rZ   c                     ^  \ rS rSrSr\R                  r\r	\
r\r\r\" 5       r\" \\SS9R'                  SS9r\" S5      S 5       r\" S	S
S\R                  4SS9r\" S5      R'                  SS9r\" SSS9R'                  SS9r\" S5      S 5       r\" SSS9R'                  SS9r\" SSS9R'                  SS9r \" S5      S 5       r!\" SSS5      S 5       r"\" S5      r#\$S!U 4S jj5       r%S r&S r'S r(S r)S r*U =r+$ )"rU      ipythonz\Class to use to instantiate the TerminalInteractiveShell object. Useful for custom Frontends)klassdefault_valuehelpT)configclassesc                     [         U R                  [        [        [        [
        [        [        [        [        [        /$ )zCThis has to be in a method, for TerminalIPythonApp to be available.)r   r,   r   r   r   r   r
   r   r   r   r   rb   s    r-   _classes_default#TerminalIPythonApp._classes_default   s3      NN$
 	
r/   )z"IPython.core.profileapp.ProfileAppz#Create and manage IPython profiles.)zipykernel.kernelapp.IPKernelAppz,Start a kernel without an attached frontend.z'IPython.terminal.ipapp.LocateIPythonApp)z"IPython.core.historyapp.HistoryAppz$Manage the IPython history database.)r\   kernellocatehistoryFz>Start IPython quickly by skipping the loading of config files.)rl   rV   c                 *    US   (       a	  S U l         g g )Nnewc                      g rK   rA   )akws     r-   rO   3TerminalIPythonApp._quick_changed.<locals>.<lambda>   s    Tr/   )load_config_filer'   changes     r-   _quick_changed!TerminalIPythonApp._quick_changed   s    %=$9D! r/   z2Whether to display a banner upon starting IPython.zIf a command or file is given via the command-line,
        e.g. 'ipython foo.py', start an interactive shell after executing the
        file or command.rW   c                 (    US   (       a  SU l         g g )Nrv   T)interactr|   s     r-   _force_interact_changed*TerminalIPythonApp._force_interact_changed  s    %= DM r/   file_to_runcode_to_runmodule_to_runc                 l    US   nU(       a  SU l         U(       a  U R                  (       d  SU l        g g g )Nrv   TF)something_to_runrW   r   )r'   r}   rv   s      r-   _file_to_run_changed'TerminalIPythonApp._file_to_run_changed  s/    Um$(D!t** % +3r/   c                 t  > [         [        U ]  U5        U R                  b  gU R                  (       a%  U R
                  (       d  U R                  S   U l        U R                  5         U R                  5         U R                  5         U R                  5         U R                  5         U R                  5         g)z8Do actions after construct, but before starting the app.Nr   )r%   rU   
initializer^   
extra_argsr   r   	init_path
init_shellinit_bannerinit_gui_pylabinit_extensions	init_code)r'   argvr,   s     r-   r   TerminalIPythonApp.initialize  s     	 $248;;"??4#8#8#q1Dr/   c                     U R                   R                  U U R                  U R                  U R                  S9U l        U R
                  R                  R                  U 5        g)z(initialize the InteractiveShell instance)parentprofile_dirra   r8   N)interactive_shell_classinstancer   ra   r8   r7   configurablesr6   rb   s    r-   r   TerminalIPythonApp.init_shell&  sV     11::$$($4$4$($4$4dll ; L
 	

  ''-r/   c                     U R                   (       a+  U R                  (       a  U R                  R                  5         U R                  [
        R                  ::  a  [        5         gg)zoptionally display the bannerN)display_bannerr   r7   show_banner	log_levelloggingINFOr`   rb   s    r-   r   TerminalIPythonApp.init_banner1  s8    4==JJ""$>>W\\)57)r/   c                 L    US:X  a  [         R                  " S5        SU l        gg)z,Replace --pylab='inline' with --pylab='auto'inlinez>'inline' not available as pylab backend, using 'auto' instead.autoN)warningswarnpylab)r'   nameoldrv   s       r-   _pylab_changed!TerminalIPythonApp._pylab_changed8  s&    (?MM . /DJ r/   c                    U R                   b  U R                   R                  5       $ U R                  (       a6  U R                  R	                  S5        U R
                  R                  5         g U R                  R	                  S5        U R
                  R                  5         U R
                  R                  (       d  [        R                  " S5        g g )NzStarting IPython's mainloop...zIPython not interactive...r   )r^   r_   r   logdebugr7   mainlooprestore_term_titlelast_execution_succeededsysexitrb   s    r-   r_   TerminalIPythonApp.start?  s    ;;";;$$&&==HHNN;<JJ!HHNN78JJ))+::66 7r/   )r   r   r{   r   r7   r   rK   ),rB   rC   rD   rE   r   r   cl_usagerd   r    crash_handler_class	_examplesexamplesflagsaliasesr   rn   r   objectr   tagr   r   rp   re   rZ   rf   r   auto_createrV   r   r~   r   rW   r   r   r   r   r   r   r   r   r_   rG   rH   rI   s   @r-   rU   rU      s   D..K+HEGfG".k 
cc	  Y
 
  

 :((

K  t*...-K Q	cc 
 W: : $A	cc  % 
cc	 
 ! ! ]M?;& <& %[ &	.3  r/   c                     U c
  [        5       n [        R                  R                  U S5      n[	        5       nUR
                  R                  U5        UR                  5         UR                  $ )z`Load the default config file from the default ipython_dir.

This is useful for embedded shells.
profile_default)	r   ospathr:   rU   config_file_pathsr6   r{   rm   )ra   r   r(   s      r-   load_default_configr   L  sY    
 %''',,{,=>K

C  -::r/   rK   )FrF   r   r   r   r   traitlets.config.loaderr   traitlets.config.applicationr   r   IPython.corer   r   IPython.core.completerr   IPython.core.crashhandlerr	   IPython.core.formattersr
   IPython.core.historyr   IPython.core.applicationr   r   r   r   IPython.core.magicr   IPython.core.magicsr   r   IPython.core.shellappr   r   r   IPython.extensions.storemagicr   interactiveshellr   IPython.pathsr   	traitletsr   r   r   r   r   r   r    re   r   rM   rL   addflagclassic_configInteractiveShell
cache_sizepprintprompts_classseparate_inseparate_outseparate_out2colorsxmoder   rZ   rU   r   launch_instancelaunch_new_instancerA   r/   r-   <module>r      sC    	 
  * I    . 2 6 /  -  6 6 ) 	$ B 	Z [ 
B E;< A7;
 517 ?= *	 	)*)	 ;-. -.   *+0 ! ! (-  ' ' 5 /1   +/1   ,02   -)2   &(/   % @y  Wt,-0w  -56s  ^ 
|
 } $- $O/1D Ob )88 r/   