Ñò
BÕAHc           @   sk  d  Z  d d k l Z d e i d Z e i Z e i Z y# d e	 i
 e	 _
 e i
 d 7_
 Wn e j
 o n Xd d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k l Z l Z d d	 k l Z d d
 k l Z d d k l Z d d k l Z d d k l Z d d k l Z l  Z  d d k! Td „  Z" d d d d d e e$ d „ Z% d S(   s¾   
IPython -- An enhanced Interactive Python

Requires Python 2.1 or better.

This file contains the main make_IPython() starter function.

$Id: ipmaker.py 2930 2008-01-11 07:03:11Z vivainio $iÿÿÿÿ(   t   Releases   %s <%s>t   Fernandos   
    Python: %s

    IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users.
    See http://ipython.scipy.org for more information.sa   

    Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray.
    All Rights Reserved.N(   t   pprintt   pformat(   t	   DPyGetOpt(   t   Struct(   t
   OutputTrap(   t   ConfigLoader(   t   InteractiveShell(   t   cmd_line_usaget   interactive_usage(   t   *c         C   s<   |  t  i j o d G|  GHt t  i |  ƒ n t |  ƒ d  S(   Nt   reload(   t   syst   modulesR   t
   __import__(   t   modname(    (    sG   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/ipmaker.pyt   force_import=   s    	i   c   <   {   J   s+  e  } |  d j o e i }  n | d d | d | d | | }	 y$ d d k l }
 |
 ƒ  |	 i d <Wn e j
 o e d ƒ n Xh  |	 _	 | o) d d	 k
 l } | i d
 d ƒ e _ n d e i i d ƒ d f d e f d g |	 _ e |	 _ e i d j o d } d } n d } d } e i i e i i d e i i |	 i | ƒ ƒ ƒ } e i i d d ƒ d d k
 } e i i | i ƒ } ~ d } d } e | ƒ e | ƒ } e  d d d d d d d d d g  d d d  d d! d" d# d d$ d d% d& d' d d( d d) d d* d+ d, d d d d- d d. | d/ d d0 d d1 d d2 d d3 d d4 d d5 d d6 d d7 d d8 d d9 d: d; d< d= d> d? d d@ d dA d dB d dC d dD d dE d dF dG | dH d dI d dJ d dK d dL d dM d dN d dO dP dQ d dR d dS d dT d dU d dV d dW d dX d+ dY dZ d[ d ƒ :} h d\ e! 6d] e" 6d^ e# 6d_ d 6} e  d` g  da g  db g  dc g  g dd g  de g  df g  dg g  dh d ƒ 	} | i$ ƒ  } | i% e& | ƒ ƒ | d c di | d 7<| d | e' <| d =| i$ ƒ  } | i% | ƒ h di i | e( | e' g ƒ dj 6di i | e! | e" | e# g ƒ dk 6} e) i) ƒ  } | i* d ƒ | i+ | ƒ y | i, |  ƒ Wn8 e) i- j
 o) } e. GHe dl | ƒ e i/ d ƒ n Xe  | i0 ƒ } | i1 } | i% | ƒ | i2 o e3 e. ƒ e i/ ƒ  n | i4 o e GHe i/ ƒ  n | i5 o |	 i6 dm ƒ e i/ ƒ  n e i i7 e i i | i8 ƒ ƒ e i i9 | i8 ƒ p |	 i: | i8 | dn ƒ n | i; o |	 i: | i8 | dT ƒ n e< | e do ƒ e dp ƒ e dq ƒ e dr ƒ g ƒ d } | i= o"| i= } | i> } y e? | i= ƒ }  WnO e@ j
 oC | i> o |	 iA ƒ  n e ds | i= ƒ d }  d } | `= qûXyq |  iB ƒ  |  iB ƒ  |  iB ƒ  dt }! |! d U| | _> | | _= | i% | ƒ |  iB ƒ  dt }! |! d U|  iC ƒ  Wqû|  iC ƒ  | i> o |	 iA ƒ  n e du ƒ qûXn dv }" dw }# d }$ e  dx eD dy |" |# |$ | dz d ƒd{ eD d| |" |# |$ | ƒ d1 eD d} |" |# |$ | ƒ d~ d ƒ }% |% iE iF ƒ  y eG | iH | i8 ƒ | _H Wn< e@ j
 o0 | i> o |	 iA ƒ  n e d | iH ƒ n Xe  }& | iI oe y* eG d€ | iI | | i8 ƒ | _H eJ }& WqGe@ j
 o( | i> o |	 iA ƒ  n d | _I qGXn d }' | iK o	 d GHn‘ | iH ol y> eL | ƒ }( |( iM | iH | d` | i8 d‚ d dƒ | dj ƒ}' Wqð|	 iA ƒ  e d„ | iH d… ƒ qðXn e d† d‡ | i8 dˆ ƒ eD d‰ d ƒ }) |	 iN | iO ƒ |) iP ƒ  | i$ ƒ  |	 _Q |	 iQ }* |* i% | ƒ |' o |* i% |' ƒ n |* i% | ƒ |* i% | ƒ | |* _R | |* _S e  ƒ  |	 _T |* iU oc d |* _K d |* _V d |* _W dŠ |* _X d‹ |* _Y d |* _Z d+ |* _[ |* _\ |* _] d& |* _^ dŒ |* _O n |	 i_ ƒ  |* iI o d |* iI }+ n dŽ }+ e i i | i8 |+ ƒ |	 _` |) ia ƒ  |	 iN |* iO ƒ |) iP ƒ  |* i= o |	 ib |* i= d ƒ n7 |* ic o |	 ib |* ic ƒ n |* id o |	 ib ƒ  n |* ie if ƒ  d+ j oT y e i d }, Wn3 eg j
 o' e i d j o
 d‘ }, qd’ }, n X|, |* _e n |	 ih |* _h y= d d“ k
 li }- |* ii o |- ij ek _j n |- ij ek _l ~- Wn e j
 o n X|	 im i% en io ƒ |* i> o  d” GHd• GHd– GHeW |* io ƒ n xB |* ip D]7 }. y d— |. |	 i UWqÍ|	 iA ƒ  eq |. ƒ qÍXqÍWx| |* ir D]q }/ |/ g  j p^ |/ d d˜ i |/ d ƒ }. }0 y d™ |. dš |0 |	 i UWqƒ|	 iA ƒ  eq |. |0 ƒ qƒXqqWxF |* is D]; }. y d™ |. d› |	 i UWq‘|	 iA ƒ  eq |. ƒ q‘Xq‘WxC |* it D]8 }1 y |1 |	 i UWqÚ|	 iA ƒ  e dœ |1 ƒ qÚXqÚWxs |* iu D]h }2 y eG |2 e i | g ƒ }2 Wn# e@ j
 o e ev d ƒ ƒ q X|	 iw e i ix |2 ƒ |	 i ƒ q Wy d d ky }3 WnO e j
 o) | i> o |	 iA ƒ  n e dž ƒ n |	 iA ƒ  eq dŸ ƒ n X| iI oR |& oJ d  | iI }4 y ez |4 ƒ WqT|	 iA ƒ  d¡ G|4 Gd¢ GHeq |4 ƒ qTXn ez d£ ƒ y ez d¤ ƒ WnM | i8 d¥ }5 |	 iA ƒ  e i i{ |5 ƒ p e |5 d¦ ƒ n eq d¤ ƒ n X|* i% | ƒ |% iE i| ƒ  |* i} o |% i~ |% iE i ƒ  7_~ n |	 i	 i% |	 i ƒ | o¨ d§ GHy} |* i> o
 d }6 n d }6 |% i= iF ƒ  |	 iw | |	 i d¨ d dE |6 ƒ|% i= i| ƒ  |* i} o |% i~ |% i= i ƒ  7_~ n Wq´e d© | ƒ |	 iA ƒ  q´Xn |% i€ iF ƒ  | o± |* iS o§ |* iS d i ƒ  i‚ dª ƒ o‰ |	 i d« }7 d¬ |	 i d« <e i |	 i }8 e _ e i d }9 | e _ z |	 iw | d |	 i ƒ Wd |8 e _ |9 e i (|7 |	 i d« <Xn |% i€ i| ƒ  |* i} o |% i~ |% i€ i ƒ  7_~ n |* iƒ o d+ |* _[ |* _\ |* _] n |* i[ d+ j o d |* _[ n |* i\ d+ j o d |* _\ n |* i] d+ j o d |* _] n |* i[ i„ d­ d ƒ |* _[ |* i\ i„ d­ d ƒ |* _\ |* i] i„ d­ d ƒ |* _] |* i[ i… d ƒ d }: |* i† |: |* _† |* i‡ o d |* _ˆ n |* iˆ o |	 i }; n g  }; |* iI o |; i7 d® |* iI ƒ n |% i~ o |; i7 |% i~ ƒ n d i |; ƒ |	 _‰ |	 iŠ ƒ  |	 S(¯   sc  This is a dump of IPython into a single function.

    Later it will have to be broken up in a sensible manner.

    Arguments:

    - argv: a list similar to sys.argv[1:].  It should NOT contain the desired
    script name, b/c DPyGetOpt strips the first argument only for the real
    sys.argv.

    - user_ns: a dict to be used as the user's namespace.t   __IPt   user_nst   user_global_nst   embeddediÿÿÿÿ(   t   _Helpert   helps$   help() not available - check site.py(   t   ultraTBt   call_pdbi   sI   Python %s
Type "copyright", "credits" or "license" for more information.
s   
i    s-   IPython %s -- An enhanced Interactive Python.sÌ   ?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.
t   posixt    s   .ipythons   .init   _ipythont
   IPYTHONDIRNs_  autocall=i autoindent! automagic! banner! cache_size|cs=i c=s classic|cl color_info! colors=s confirm_exit! debug! deep_reload! editor=s log|l messages! nosep object_info_string_level=i pdb! pprint! prompt_in1|pi1=s prompt_in2|pi2=s prompt_out|po=s pydb! pylab_import_all! quick screen_length|sl=i prompts_pad_left=i logfile|lf=s logplay|lp=s profile|p=s readline! readline_merge_completions! readline_omit__names! rcfile=s separate_in|si=s separate_out|so=s separate_out2|so2=s xmode=s wildcards_case_sensitive! magic_docstrings system_verbose! multi_line_specials! term_title! wxversion=s autoedit_syntax!sg   help interact|i ipythondir=s Version upgrade gthread! qthread! q4thread! wthread! tkthread! pylab! tk! t   autocallt   autoedit_syntaxt
   autoindentt	   automagict   autoexect   bannert   ct
   cache_sizeiè  t   classict
   color_infot   colorst   NoColort   confirm_exitt   debugt   deep_reloadt   editort   0t   gthreadt   interactt
   ipythondirt   logt   logfilet   logplayt   messagest   multi_line_specialst   nosept   object_info_string_levelt   pdbR   t   profilet
   prompt_in1s	   In [\#]: t
   prompt_in2s	      .\D.: t
   prompt_outs	   Out[\#]: t   prompts_pad_leftt   pylabt   pylab_import_allt   q4threadt   qthreadt   quickt   quiett   rcfilet	   ipythonrct   readlinet   readline_merge_completionst   readline_omit__namest   screen_lengtht   separate_int   separate_outt   separate_out2t   system_headers   IPython system call: t   system_verboset
   term_titlet   tkt   upgradet   Versiont   wildcards_case_sensitivet   wthreadt	   wxversiont   xmodet   Contextt   magic_docstringss'   include import_mod import_all execfile s   import_some s&   execute alias readline_parse_and_bind s   readline_remove_delims t   includet
   import_modt
   import_allt   import_somet   executet   execfilet   aliast   readline_parse_and_bindt   readline_remove_delimst    t   preservet   add_flips   
Error in Arguments: "%s"s   -latext   installs   log logfiles   rcfile profiles   classic profiles   classic rcfiles   Could not open logplay file i   sg   Logplay file lacking full configuration information.
I'll try to read it, but some things may not work.s   Output messages. s   Error messages. t   configs   Configuration Loadert	   quiet_outt	   user_execs   User File Executions
   Log Loadert   summarys2   Configuration file %s not found. Ignoring request.s
   ipythonrc-s5   Launching IPython in quick mode. No config file read.t   purget   uniques$   Problems loading configuration file s2   
Starting with default -bare bones- configuration.s?   No valid configuration file found in either currrent directory
s%   or in the IPython config. directory: s#   
Proceeding with internal defaults.t   trap_outs   >>> s   ... t   Plains
   history-%st   historys    appendt   EDITORt   vit   notepad(   R,   s8   Trying to execute the following configuration structure:s=   (Things listed first are deeper in the inclusion tree and gets   loaded first).
s   import t   ,s   from s    import s	    import *s   Failure executing code: s"   File $file not found. Skipping it.s"   Could not import 'ipy_system_conf't   ipy_system_conft   ipy_profile_s   Error importings"   - perhaps you should run %upgrade?t   ipy_profile_nonet   ipy_user_confs   /ipy_user_conf.pys%    does not exist, please run %upgrade!s   Replaying log...t   islogs   Problems replaying logfile %s.s   .ipyt   __name__t   __main__s   \ns   IPython profile: %s
(‹   t   Falset   NoneR   t   argvt   siteR   R   t   ImportErrort   warnt   user_config_nst   IPythonR   t	   VerboseTBt
   excepthookt   versiont   splitt   __version__t   BANNER_PARTSR
   t   usaget   ost   namet   patht   abspatht   environt   gett   joint   home_dirt   insertt   dirnamet   __file__t   qwR   t   qwflatt   qw_lolt   list_stringst   copyt   updatet   optstr2typest   unquote_endst   intR   t   setIgnoreCaset   parseConfigurationt   processArgumentst   ArgumentErrorR	   t   exitt   optionValuest
   freeValuesR   t   pageRS   RY   t   magic_magict   appendR1   t   isdirt
   user_setupRR   t
   mutex_optsR4   R+   t   opent   IOErrort   InteractiveTBRG   t   closeR   Rg   t   trap_allt   filefindRE   R:   t   TrueRC   R   t   loadt   magic_xmodeRW   t   release_outt   rct   optst   argst
   runtime_rcR&   R%   R   R;   R<   R=   RK   RL   RM   R(   t   pre_config_initializationt   histfileRm   t   magic_logstartR3   R2   R-   t   stript   KeyErrorR   R,   R   t   __builtin__t   dreloadt   internal_nsRz   t   __dict__R[   t   import_fail_infoR]   R\   R^   R_   t   itplt   safe_execfilet
   expanduserRt   R   t   isfilet   release_allR5   Rj   t   summary_allRi   t   lowert   endswithR7   t   replacet   countRJ   R$   R#   t   BANNERt   post_config_initialization(<   R}   R   R   R+   t   rc_overridet   shell_classR   t   kwt   DEVDEBUGt   IPR   R   t	   rc_suffixt	   ipdir_deft   ipythondir_defR‚   t   IPython_dirt   cmdline_optst   cmdline_onlyt
   opts_namest   opts_deft   rcfile_optst   rc_deft   typeconvt   opts_allt   conflictt   getoptt   excR¶   R·   t   load_logplayt   opts_debug_saveR4   t   cmdt   msg_outt   msg_errt   msg_sept   msgt   profile_handled_by_legacyt
   rcfiledatat
   cfg_loadert   otrapt   IP_rct	   histfnamet   edR,   t   modt   mod_fnt   fnt   codet   fileRt   t   profmodnamet   conft   logplay_quiett	   name_savet   old_excepthookt	   save_argvt   num_lines_bott   BANN_P(    (    sG   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/ipmaker.pyt   make_IPythonF   s,   
		

	

			





		
 

		

 				
 


 
	


			
							










 

 

 

 

 #
 







 		


   


 
 
(&   t   __doc__R‚   R    t   authorst
   __author__t   licenset   __license__R…   R‡   t   creditst   _Printer__datat	   copyrightt	   NameErrorRz   R¾   RŠ   t   reR   t   typesR   R   R   t   IPython.ipstructR   t   IPython.OutputTrapR   t   IPython.ConfigLoaderR   t   IPython.iplibR   t   IPython.usageR	   R
   t   IPython.genutilsR   R|   R{   Rþ   (    (    (    sG   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/ipmaker.pyt   <module>	   s:   			
		