;ò
úÓAHc           @   s‚  d  Z  d k l Z d e i d Z e i Z d k Z d k Z d k	 Z	 d k
 Z
 d k Z d k Z d k Z d k Z d k Z d k l Z l Z y d k Z e Z Wn e j
 o e Z n Xd k Z d k l Z l Z d k l Z l Z l Z l Z l Z d k l  Z  d	 k! l" Z" d
 k# l$ Z$ d k% l& Z& y e' Wn% e( j
 o d k) Z) e) i* Z' n Xe a+ e a, e i- ƒ  Z. e/ a0 d f  d „  ƒ  YZ1 d d „ Z2 d f  d „  ƒ  YZ3 e o d „  Z4 d „  Z5 n
 d „  Z5 d e  f d „  ƒ  YZ6 d f  d „  ƒ  YZ7 d e7 e  f d „  ƒ  YZ8 d e7 e6 f d „  ƒ  YZ9 d „  Z: d „  Z; d „  Z< d  „  Z= d! „  Z> d" „  Z? d# „  Z@ d$ e iA f d% „  ƒ  YZB d& eB f d' „  ƒ  YZC d( eB f d) „  ƒ  YZD d* eB f d+ „  ƒ  YZE d, eB f d- „  ƒ  YZF d. „  ZG d/ e1 f d0 „  ƒ  YZH d1 eC f d2 „  ƒ  YZI d3 eD f d4 „  ƒ  YZJ d5 eE f d6 „  ƒ  YZK d7 eF f d8 „  ƒ  YZL d9 „  ZM e/ d: „ ZN e1 ZO e3 ZP d S(;   s¦   IPython Shell classes.

All the matplotlib support code was co-developed with John Hunter,
matplotlib's author.

$Id: Shell.py 3024 2008-02-07 15:34:42Z darren.dale $(   s   Releases   %s <%s>s   FernandoN(   s   signals   SIGINT(   s   ultraTBs   ipapi(   s   Terms   warns   errors
   flag_callss
   ask_yes_no(   s   InteractiveShell(   s   make_IPython(   s   Magic(   s   Structs   IPShellc           B   s5   t  Z d  Z e e e d e d „ Z d e d „ Z RS(   s   Create an IPython instance.i   c      
   C   s+   t  | d | d | d | d | ƒ|  _ d  S(   Ns   user_nss   user_global_nss   debugs   shell_class(   s   make_IPythons   argvs   user_nss   user_global_nss   debugs   shell_classs   selfs   IP(   s   selfs   argvs   user_nss   user_global_nss   debugs   shell_class(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__M   s    i    c         C   s)   |  i i | ƒ | o t i ƒ  n d  S(   N(   s   selfs   IPs   mainloops   banners   sys_exits   syss   exit(   s   selfs   sys_exits   banner(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   mainloopS   s    (   s   __name__s
   __module__s   __doc__s   Nones   InteractiveShells   __init__s   mainloop(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   IPShellJ   s    s    c         C   s/   t  d d ƒ } | o t |  i _ d GHn d S(   sË  %kill_embedded : deactivate for good the current embedded IPython.

    This function (after asking for confirmation) sets an internal flag so that
    an embedded IPython will never activate again.  This is useful to
    permanently disable a shell that is being called inside a loop: once you've
    figured out what you needed from it, you may then kill it and the program
    will then continue to run without the interactive shell interfering again.
    sB   Are you sure you want to kill this embedded instance (y/n)? [y/N] s   ns@   This embedded IPython will not reactivate anymore once you exit.N(   s
   ask_yes_nos   kills   Falses   selfs   shells   embedded_active(   s   selfs   parameter_ss   kill(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   kill_embeddedY   s     	s   IPShellEmbedc           B   sh   t  Z d  Z e d e e e d „ Z d „  Z d e e e d „ Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   s  Allow embedding an IPython shell into a running program.

    Instances of this class are callable, with the __call__ method being an
    alias to the embed() method of an InteractiveShell instance.

    Usage (see also the example-embed.py file for a running example):

    ipshell = IPShellEmbed([argv,banner,exit_msg,rc_override])

    - argv: list containing valid command-line options for IPython, as they
    would appear in sys.argv[1:].

    For example, the following command-line options:

      $ ipython -prompt_in1 'Input <\#>' -colors LightBG

    would be passed in the argv list as:

      ['-prompt_in1','Input <\#>','-colors','LightBG']

    - banner: string which gets printed every time the interpreter starts.

    - exit_msg: string which gets printed every time the interpreter exits.

    - rc_override: a dict or Struct of configuration options such as those
    used by IPython. These options are read from your ~/.ipython/ipythonrc
    file when the Shell object is created. Passing an explicit rc_override
    dict with any options you want allows you to override those values at
    creation time without having to modify the file. This way you can create
    embeddable instances configured in any way you want without editing any
    global files (thus keeping your interactive IPython configuration
    unchanged).

    Then the ipshell instance can be called anywhere inside your code:
    
    ipshell(header='') -> Opens up an IPython shell.

    - header: string printed by the IPython shell upon startup. This can let
    you know where in your code you are when dropping into the shell. Note
    that 'banner' gets prepended to all calls, so header is used for
    location-specific information.

    For more details, see the __call__ method below.

    When the IPython shell is exited with Ctrl-D, normal program execution
    resumes.

    This functionality was inspired by a posting on comp.lang.python by cmkl
    <cmkleffner@gmx.de> on Dec. 06/01 concerning similar uses of pyrepl, and
    by the IDL stop/continue commands.s    c         C   sò   |  i | ƒ |  i | ƒ |  i d ƒ t i |  _ y t i	 |  _
 Wn n Xt | d | d t d | ƒ|  _ t i |  i ƒ } | i d t ƒ t i |  _ |  i t _ t i d |  i i i d |  i i i d |  i i i ƒ t _ |  i ƒ  d	 S(
   s,   Note that argv here is a string, NOT a list.i    s   rc_overrides   embeddeds   user_nss   kill_embeddeds   color_schemes   modes   call_pdbN(   s   selfs
   set_banners   banners   set_exit_msgs   exit_msgs   set_dummy_modes   syss   displayhooks   sys_displayhook_oris   ipcompleters   sys_ipcompleter_oris   make_IPythons   argvs   rc_overrides   Trues   user_nss   IPs   ipapis   IPApis   ips   expose_magics   kill_embeddeds   sys_displayhook_embeds   ultraTBs   FormattedTBs   rcs   colorss   xmodes   pdbs
   excepthooks   restore_system_completer(   s   selfs   argvs   banners   exit_msgs   rc_overrides   user_nss   ip(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__   s(     c         C   s4   y& |  i i i |  i ƒ |  i t _ Wn n Xd S(   s¡   Restores the readline completer which was in place.

        This allows embedded IPython within IPython not to disrupt the
        parent's completion.
        N(   s   selfs   IPs   readlines   set_completers   sys_ipcompleter_oris   syss   ipcompleter(   s   self(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   restore_system_completerÁ   s     c         C   sò   |  i i o d Sn t |  i _ | p | d j o |  i o d Sn |  i t _	 |  i i
 o |  i i ƒ  n |  i o | o
 d } n d } | |  i | f } |  i i | | | d d ƒ|  i o |  i GHn |  i t _	 |  i ƒ  d S(   sG  Activate the interactive interpreter.

        __call__(self,header='',local_ns=None,global_ns,dummy=None) -> Start
        the interpreter shell with the given local and global namespaces, and
        optionally print a header string at startup.

        The shell can be globally activated/deactivated using the
        set/get_dummy_mode methods. This allows you to turn off a shell used
        for debugging globally.

        However, *each* time you call the shell you can override the current
        state of dummy_mode with the optional keyword parameter 'dummy'. For
        example, if you set dummy mode on with IPShell.set_dummy_mode(1), you
        can still have a specific call work by making it as IPShell(dummy=0).

        The optional keyword parameter dummy controls whether the call
        actually does anything.  Ni    s   %s
%s
s   %s%s
s   stack_depthi   (   s   selfs   IPs   embedded_actives   Falses   exit_nows   dummys   _IPShellEmbed__dummy_modes   sys_displayhook_embeds   syss   displayhooks   has_readlines   set_completers   banners   headers   formats   embed_mainloops   local_nss	   global_nss   exit_msgs   sys_displayhook_oris   restore_system_completer(   s   selfs   headers   local_nss	   global_nss   dummys   formats   banner(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __call__Î   s$     

c         C   s3   | d d t t g j o t d ‚ n | |  _ d S(   sk  Sets the embeddable shell's dummy mode parameter.

        set_dummy_mode(dummy): dummy = 0 or 1.

        This parameter is persistent and makes calls to the embeddable shell
        silently return without performing any action. This allows you to
        globally activate or deactivate a shell you're using with a single call.

        If you need to manuallyi    i   s   dummy parameter must be booleanN(   s   dummys   Falses   Trues
   ValueErrors   selfs   _IPShellEmbed__dummy_mode(   s   selfs   dummy(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   set_dummy_mode  s    	 c         C   s   |  i Sd S(   s>   Return the current value of the dummy mode parameter.
        N(   s   selfs   _IPShellEmbed__dummy_mode(   s   self(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   get_dummy_mode  s     c         C   s   | |  _  d S(   s~   Sets the global banner.

        This banner gets prepended to every header printed when the shell
        instance is called.N(   s   banners   self(   s   selfs   banner(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys
   set_banner  s     c         C   s   | |  _  d S(   s—   Sets the global exit_msg.

        This exit message gets printed upon exiting every time the embedded
        shell is called. It is None by default. N(   s   exit_msgs   self(   s   selfs   exit_msg(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   set_exit_msg  s     (   s   __name__s
   __module__s   __doc__s   Nones   __init__s   restore_system_completers   __call__s   set_dummy_modes   get_dummy_modes
   set_banners   set_exit_msg(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   IPShellEmbedi   s   2 $	5			c         C   s   t  i | ƒ o t d ƒ ‚ n t i i |  t i | ƒ ƒ } | d j o t
 d ƒ ‚ n1 | d j o# t i i |  d ƒ t d ƒ ‚ n d S(   s0   raises the exception, performs cleanup if neededs(   Only types can be raised (not instances)i    s   invalid thread idi   s    PyThreadState_SetAsyncExc failedN(   s   inspects   isclasss   exctypes	   TypeErrors   ctypess	   pythonapis   PyThreadState_SetAsyncExcs   tids	   py_objects   ress
   ValueErrors   SystemError(   s   tids   exctypes   res(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   _async_raise+  s     c         C   s3   t  o t t t ƒ n t a d Gt i i ƒ  d S(   sk  Sigint handler for threaded apps.

        This is a horrible hack to pass information about SIGINT _without_
        using exceptions, since I haven't been able to properly manage
        cross-thread exceptions in GTK/WX.  In fact, I don't think it can be
        done (or at least that's my understanding from a c.l.py thread where
        this was discussed).s/   
KeyboardInterrupt - Press <Enter> to continue.N(	   s   CODE_RUNs   _async_raises   MAIN_THREAD_IDs   KeyboardInterrupts   Trues   KBINTs   Terms   couts   flush(   s   signums   stack_frame(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   sigint_handler9  s      c         C   s   d Gt  i i ƒ  t a d S(   sk  Sigint handler for threaded apps.

        This is a horrible hack to pass information about SIGINT _without_
        using exceptions, since I haven't been able to properly manage
        cross-thread exceptions in GTK/WX.  In fact, I don't think it can be
        done (or at least that's my understanding from a c.l.py thread where
        this was discussed).s/   
KeyboardInterrupt - Press <Enter> to continue.N(   s   Terms   couts   flushs   Trues   KBINT(   s   signums   stack_frame(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   sigint_handlerL  s
      s   MTInteractiveShellc           B   s\   t  Z d  Z e Z e e d e d e ƒ e e d d „ Z d d d „ Z d „  Z	 d	 „  Z
 RS(
   s   Simple multi-threaded shell.s   optss   argss    c   
      K   s‹   t  i |  | | | | | | ƒ t	 i	 ƒ  |  _
 t |  _ | i d g  ƒ }	 x) |	 D]! } t | ƒ o t d ‚ qP qP W|	 |  _ t |  _ d S(   sB   Similar to the normal InteractiveShell, but with threading controls   on_kills#   on_kill must be a list of callablesN(   s   InteractiveShells   __init__s   selfs   names   usages   rcs   user_nss   user_global_nss   banner2s   Queues
   code_queues   Nones   _kills   kws   gets   on_kills   ts   callables	   TypeErrors   worker_ident(
   s   selfs   names   usages   rcs   user_nss   user_global_nss   banner2s   kws   ts   on_kill(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__i  s     
	 	s   <input>s   singlec         C   s>  t  o t a  t Sn |  i o t Sn y |  i | | | ƒ } Wn- t
 t t f j
 o |  i | ƒ t Sn X| t j o t Sn |  i t j p |  i t i ƒ  j o t i |  | ƒ d Sn t i ƒ  t i ƒ  f \ } } |  i i | | | f ƒ | i d ƒ | i ƒ  o d GHd GHt |  _ n | i ƒ  t Sd S(   s´   Compile and run some source in the interpreter.

        Modified version of code.py's runsource(), to handle threading issues.
        See the original for full docstring details.Ni   s-   Warning: Timeout for mainloop thread exceededs=   switching to nonthreaded mode (until mainloop wakes up again)(   s   KBINTs   Falses   selfs   _kills   Trues   compiles   sources   filenames   symbols   codes   OverflowErrors   SyntaxErrors
   ValueErrors   showsyntaxerrors   Nones   worker_idents   threads	   get_idents   InteractiveShells   runcodes	   threadings   Events   completed_evs   received_evs
   code_queues   puts   waits   isSet(   s   selfs   sources   filenames   symbols   codes   received_evs   completed_ev(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys	   runsource  s4      
	&
c         C   s‡  t  i ƒ  |  _ |  i oW t i d It i i ƒ  x |  i D] } | ƒ  q= Wt i d IJ|  i i
 ƒ  t Sn y t t t ƒ Wn t j
 o n Xt } xß n o× y |  i i ƒ  \ } } } Wn t i j
 o Pn X| i
 ƒ  z y t a t i |  | ƒ Wn^ t j
 oR d GHxB |  i i ƒ  o0 |  i i ƒ  \ } } } | i
 ƒ  | i
 ƒ  qWPn XWd t  a | i
 ƒ  Xq§ Wt Sd S(   sQ   Execute a code object.

        Multithreaded wrapper around IPython's runcode().s   Closing threads...s   Done.i   s    Keyboard interrupted in mainloopN(!   s   threads	   get_idents   selfs   worker_idents   _kills   Terms   couts   flushs   on_kills   tokills   sets   Trues   signals   SIGINTs   sigint_handlers   SystemErrors   Nones   code_to_runs
   code_queues
   get_nowaits   completed_evs   received_evs   Queues   Emptys   CODE_RUNs   InteractiveShells   runcodes   KeyboardInterrupts   emptys   codes   ev1s   ev2s   False(   s   selfs   code_to_runs   codes   received_evs   completed_evs   tokills   ev2s   ev1(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   runcode´  sP      

  
 

 c         C   s    t  i ƒ  |  _ |  i i ƒ  d S(   s6   Kill the thread, returning when it has been shut down.N(   s	   threadings   Events   selfs   _kills   wait(   s   self(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   killõ  s     (   s   __name__s
   __module__s   __doc__s   Trues
   isthreadeds   Nones   Structs   __init__s	   runsources   runcodes   kill(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   MTInteractiveShell]  s    	'5	As   MatplotlibShellBasec           B   sE   t  Z d  Z d „  Z d „  Z d d „ Z d e i i d f e _ RS(   sü   Mixin class to provide the necessary modifications to regular IPython
    shell classes for matplotlib support.

    Given Python's MRO, this should be used as the FIRST class in the
    inheritance hierarchy, so that it overrides the relevant methods.c            sÖ   d k  } d k  l ‰ | i e ƒ ‡  ‡ d †  } | ˆ  _  | i d ˆ  _ | i ˆ  _ e	 ˆ  i _
 | | _ d k i } | ˆ  _ e	 ˆ  i i _ e ˆ  i i ƒ ˆ  i _ e i i | ƒ } d | Ud } | | f Sd S(   s=   Return items needed to setup the user's shell with matplotlibN(   s   backendsc            s]   |  ˆ i j o |  ˆ  i j o  d |  ˆ  i f } t | ‚ n ˆ  i |  ƒ t ˆ  i _	 d S(   s”  IPython wrapper for matplotlib's backend switcher.

            In interactive use, we can not allow switching to a different
            interactive backend, since thread conflicts will most likely crash
            the python interpreter.  This routine does a safety check first,
            and refuses to perform a dangerous switch.  It still allows
            switching to non-interactive backends.sÂ  invalid matplotlib backend switch.
This script attempted to switch to the interactive backend: `%s`
Your current choice of interactive backend is: `%s`

Switching interactive matplotlib backends at runtime
would crash the python interpreter, and IPython has blocked it.

You need to either change your choice of matplotlib backend
by editing your .matplotlibrc file, or run this script as a 
standalone file from the command line, not using IPython.
N(
   s   args   backendss   interactive_bks   selfs   mpl_backends   ms   RuntimeErrors   mpl_uses   Trues   _called(   s   args   m(   s   selfs   backends(    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   use	  s      s   backends3   import matplotlib
import matplotlib.pylab as pylab
sh   
  Welcome to pylab, a matplotlib-based Python environment.
  For more information, type 'help(pylab)'.
(   s
   matplotlibs   backendss   interactives   Trues   uses   selfs   rcParamss   mpl_backends   mpl_uses   Falses   _calleds   matplotlib.pylabs   pylabs   shows	   _needmains
   flag_callss   draw_if_interactives   IPythons   ipapis   make_user_nss   user_nss   b(   s   selfs   names   user_nss   uses   bs   pylabs
   matplotlibs   backends(    (   s   selfs   backendss=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   _matplotlib_config  s$     				c         O   s›   |  i i d } |  i i t ƒ |  i | | | Ž |  i i | ƒ |  i
 i i o  |  i
 i ƒ  t |  i
 i _ n |  i i o |  i |  i i d <n d S(   s£   Execute a matplotlib script.

        This is a call to execfile(), but wrapped in safeties to properly
        handle interactive rendering and backend switching.s   interactives   backendN(   s   selfs
   matplotlibs   rcParamss   isInteractives   interactives   Falses   safe_execfiles   fnames   wheres   kws   pylabs   draw_if_interactives   calleds   draws   mpl_uses   _calleds   mpl_backend(   s   selfs   fnames   wheres   kws   isInteractive(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys
   mplot_execC  s     s    c         C   s   t  i |  | d |  i ƒd  S(   Ns   runner(   s   Magics	   magic_runs   selfs   parameter_ss
   mplot_exec(   s   selfs   parameter_s(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys	   magic_runX  s    s   %s
%ssO   
        *** Modified %run for Matplotlib, with proper interactive handling ***(   s   __name__s
   __module__s   __doc__s   _matplotlib_configs
   mplot_execs	   magic_runs   Magic(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   MatplotlibShellBaseú  s
    	B	s   MatplotlibShellc           B   s2   t  Z d  Z e e d e d e ƒ e e d „ Z RS(   s.   Single-threaded shell with matplotlib support.s   optss   argsc      
   K   sA   |  i | | ƒ \ } } t i |  | | | | | d | | d  S(   Ns   banner2(   s   selfs   _matplotlib_configs   names   user_nss   b2s   InteractiveShells   __init__s   usages   rcs   user_global_nss   kw(   s   selfs   names   usages   rcs   user_nss   user_global_nss   kws   b2(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__g  s    (   s   __name__s
   __module__s   __doc__s   Nones   Structs   __init__(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   MatplotlibShelld  s    s   MatplotlibMTShellc           B   s2   t  Z d  Z e e d e d e ƒ e e d „ Z RS(   s-   Multi-threaded shell with matplotlib support.s   optss   argsc      
   K   sA   |  i | | ƒ \ } } t i |  | | | | | d | | d  S(   Ns   banner2(   s   selfs   _matplotlib_configs   names   user_nss   b2s   MTInteractiveShells   __init__s   usages   rcs   user_global_nss   kw(   s   selfs   names   usages   rcs   user_nss   user_global_nss   kws   b2(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__p  s    (   s   __name__s
   __module__s   __doc__s   Nones   Structs   __init__(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   MatplotlibMTShellm  s    c          C   so   t  p t i i d ƒ o t SnI y d k }  Wn t j
 o t Sn# Xt ƒ  |  i ƒ  } | i
 ƒ  | Sd S(   sÃ   Tries to import Tkinter and returns a withdrawn Tkinter root
    window.  If Tkinter is already imported or not available, this
    returns None.  This function calls `hijack_tk` underneath.
    s   TkinterN(   s   USE_TKs   syss   moduless   has_keys   Nones   Tkinters   ImportErrors	   hijack_tks   Tks   rs   withdraw(   s   Tkinters   r(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   get_tky  s     	
c          C   s:   d d „ } d d „ }  d k } | | i _ |  | _ d S(   sf   Modifies Tkinter's mainloop with a dummy so when a module calls
    mainloop, it does not block.

    i    c         C   s   d  S(   N(    (   s   selfs   n(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   misc_mainloop  s    c         C   s   d  S(   N(    (   s   n(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   tkinter_mainloop’  s    N(   s   misc_mainloops   tkinter_mainloops   Tkinters   Miscs   mainloop(   s   tkinter_mainloops   Tkinters   misc_mainloop(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys	   hijack_tk‹  s     	c         C   s   |  o |  i ƒ  n d S(   sk   Updates the Tkinter event loop.  This is typically called from
    the respective WX or GTK mainloops.
    N(   s   tks   update(   s   tk(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys	   update_tk™  s     c          C   s  d „  } y d k } Wn t j
 o d k } n X| i } t } | d  d j oq d k } t | d ƒ o t	 | d ƒ }  n0 t | d ƒ o t	 | d ƒ }  n t d ƒ ‚ |  i } | |  _ n8 | d  d j o | i i } | | i _ n t d	 ƒ | Sd S(
   s„   Modifies wxPython's MainLoop with a dummy so user code does not
    block IPython.  The hijacked mainloop function is returned.
    c          O   s   d  S(   N(    (   s   argss   kw(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   dummy_mainloop¤  s    Ni   s   2.5s   _core_s   _cores   Could not find wx core modules   2.4s5   Unable to find either wxPython version 2.4 or >= 2.5.(   s   dummy_mainloops   wxs   ImportErrors   wxPythons   __version__s   vers   Nones   orig_mainloops   hasattrs   getattrs   cores   AttributeErrors   PyApp_MainLoops   wxcs   wxPyApp_MainLoops   warn(   s   cores   vers   dummy_mainloops   orig_mainloops   wx(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys	   hijack_wx   s,     			  	
c          C   s[   d „  }  d k } | i d d d f j o | i } n
 | i } |  | _ |  | _ | Sd S(   s¬   Modifies pyGTK's mainloop with a dummy so user code does not
    block IPython.  This function returns the original `gtk.mainloop`
    function that has been hijacked.
    c          O   s   d  S(   N(    (   s   argss   kw(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   dummy_mainloopÂ  s    Ni   i   i    (   s   dummy_mainloops   gtks   pygtk_versions   mains   orig_mainloops   mainloop(   s   dummy_mainloops   gtks   orig_mainloop(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys
   hijack_gtk½  s     		 			c          C   s>   d „  }  d k } | i i } |  | i _ |  | i _ | Sd S(   s²   Modifies PyQt's mainloop with a dummy so user code does not 
    block IPython.  This function returns the original 
    `qt.qApp.exec_loop` function that has been hijacked.
    c          O   s   d  S(   N(    (   s   argss   kw(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   dummy_mainloopÐ  s    N(   s   dummy_mainloops   qts   qApps	   exec_loops   orig_mainloops   QApplication(   s   dummy_mainloops   qts   orig_mainloop(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys	   hijack_qtË  s     		c          C   sT   d „  }  d k l } l } | i i } |  | i _ |  | i _ |  | i _ | Sd S(   s±   Modifies PyQt4's mainloop with a dummy so user code does not
    block IPython.  This function returns the original 
    `QtGui.qApp.exec_` function that has been hijacked.
    c          O   s   d  S(   N(    (   s   argss   kw(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   dummy_mainloopÝ  s    (   s   QtGuis   QtCoreN(	   s   dummy_mainloops   PyQt4s   QtGuis   QtCores   qApps   exec_s   orig_mainloops   QApplications   QCoreApplication(   s   dummy_mainloops   QtCores   QtGuis   orig_mainloop(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys
   hijack_qt4Ø  s     	s   IPThreadc           B   s   t  Z d „  Z RS(   Nc         C   s$   |  i i |  i ƒ |  i i ƒ  d  S(   N(   s   selfs   IPs   mainloops   _banners   kill(   s   self(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   runí  s    (   s   __name__s
   __module__s   run(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   IPThreadì  s   s
   IPShellGTKc           B   sD   t  Z d  Z d Z e e e d e d „ Z d e d „ Z d „  Z RS(   sß   Run a gtk mainloop() in a separate thread.
    
    Python commands can be passed to the thread where they will be executed.
    This is implemented by periodically checking for passed code using a
    GTK timeout callback.id   i   c         C   s¬   d  k  } | |  _  t ƒ  |  _ t ƒ  |  _ | i d d d f j o |  i  i } n |  i  i } t	 | d | d | d | d | d | g ƒ|  _ t |  _ t i i |  ƒ d  S(	   Ni   i   i    s   user_nss   user_global_nss   debugs   shell_classs   on_kill(   s   gtks   selfs
   hijack_gtks   gtk_mainloops   get_tks   tks   pygtk_versions	   main_quits   mainquits   make_IPythons   argvs   user_nss   user_global_nss   debugs   shell_classs   IPs   Nones   _banners	   threadings   Threads   __init__(   s   selfs   argvs   user_nss   user_global_nss   debugs   shell_classs   gtks   mainquit(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__ú  s    		 	i    c         C   s  | |  _ |  i i d d d f j o d  k } | i |  i ƒ n |  i i |  i ƒ t i	 d j or y/ |  i i
 d d j o |  i i i ƒ  n Wq× t j
 o q× t j
 o t d ƒ |  i i ƒ  q× Xn |  i ƒ  |  i i i ƒ  |  i ƒ  |  i i i ƒ  |  i ƒ  d  S(   Ni   i   i    s   win32s  Your pyGTK likely has not been compiled with threading support.
The exception printout is below.
You can either rebuild pyGTK with threads, or try using 
matplotlib with a different backend (like Tk or WX).
Note that matplotlib will most likely not work in its current state!(   s   banners   selfs   _banners   gtks   pygtk_versions   gobjects   idle_adds   on_timers   syss   platforms   gtk_versions   gdks   threads_inits   AttributeErrors   RuntimeErrors   errors   IPs   InteractiveTBs   starts   threads_enters   gtk_mainloops   threads_leaves   join(   s   selfs   sys_exits   banners   gobject(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   mainloop  s&    		


c         C   s/   t  |  i ƒ |  i i ƒ  t i d ƒ t Sd S(   sY   Called when GTK is idle.

        Must return True always, otherwise GTK stops calling itf0.01N(   s	   update_tks   selfs   tks   IPs   runcodes   times   sleeps   True(   s   self(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   on_timer6  s
     (	   s   __name__s
   __module__s   __doc__s   TIMEOUTs   Nones   MTInteractiveShells   __init__s   mainloops   on_timer(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys
   IPShellGTKñ  s
    !s	   IPShellWXc           B   sD   t  Z d  Z d Z e e e d e d „ Z d „  Z d e d „ Z RS(   sÞ   Run a wx mainloop() in a separate thread.
    
    Python commands can be passed to the thread where they will be executed.
    This is implemented by periodically checking for passed code using a
    GTK timeout callback.id   i   c   	      C   s  t  | d | d | d | d | d |  i g ƒ|  _ |  i i	 i
 } | d j og y d  k
 } Wn t j
 o t d ƒ q¶ Xy | i | ƒ Wq¶ |  i i ƒ  t d | ƒ q¶ Xn d  k } t i i |  ƒ | |  _ t ƒ  |  _ t ƒ  |  _ t |  _ t |  _ d  S(	   Ns   user_nss   user_global_nss   debugs   shell_classs   on_kills   0s7   The wxversion module is needed for WX version selections1   Requested wxPython version %s could not be loaded(   s   make_IPythons   argvs   user_nss   user_global_nss   debugs   shell_classs   selfs   wxexits   IPs   rcs	   wxversions   wantedwxversions   ImportErrors   errors   selects   InteractiveTBs   wxs	   threadings   Threads   __init__s	   hijack_wxs   wx_mainloops   get_tks   tks   Nones   _banners   app(	   s   selfs   argvs   user_nss   user_global_nss   debugs   shell_classs   wantedwxversions	   wxversions   wx(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__J  s.    			c         G   s8   |  i t j	 o$ |  i i i i ƒ  |  i i ƒ  n d  S(   N(   s   selfs   apps   Nones   agents   timers   Stops   ExitMainLoop(   s   selfs   args(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   wxexitq  s    i    c            s„   | ˆ  _ ˆ  i ƒ  d ˆ  i i f ‡  d †  ƒ  Y‰ d ˆ  i i f ‡  ‡ d †  ƒ  Y} | d t ƒ ˆ  _	 ˆ  i
 ˆ  i	 ƒ ˆ  i ƒ  d  S(   Ns
   TimerAgentc              s>   t  Z ˆ  i Z ˆ  i Z ˆ  i Z d „  Z d „  Z d „  Z RS(   Nc         C   s|   |  i i |  i i B} |  i i i |  | d d d d d f d d d f d | ƒ|  i t	 ƒ | |  _
 |  i i ƒ  |  _ d  S(   Niÿÿÿÿs    s   posiÈ   s   sizeid   s   style(   s   selfs   wxs   DEFAULT_FRAME_STYLEs   TINY_CAPTION_HORIZs   styles	   MiniFrames   __init__s   parents   Shows   Falses   intervals   NewIds   timerId(   s   selfs   parents   intervals   style(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__€  s    $	c         C   sN   |  i i |  |  i ƒ |  _ |  i i |  |  i |  i ƒ |  i i |  i ƒ d  S(   N(	   s   selfs   wxs   Timers   timerIds   timers	   EVT_TIMERs   OnTimers   Starts   interval(   s   self(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys	   StartWorkˆ  s    c         C   s   t  |  i ƒ |  i i ƒ  d  S(   N(   s	   update_tks   selfs   tks   IPs   runcode(   s   selfs   event(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   OnTimer  s    (	   s   __name__s
   __module__s   selfs   wxs   IPs   tks   __init__s	   StartWorks   OnTimer(    (   s   self(    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys
   TimerAgent|  s   					s   Appc              s&   t  Z ˆ  i Z ˆ  i Z ‡ d †  Z RS(   Nc            s:   ˆ  t |  i ƒ |  _ |  i i t ƒ |  i i ƒ  t Sd S(   s2   Create the main window and insert the custom frameN(	   s
   TimerAgents   Nones   selfs   TIMEOUTs   agents   Shows   Falses	   StartWorks   True(   s   self(   s
   TimerAgent(    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   OnInit”  s
     (   s   __name__s
   __module__s   selfs   wxs   TIMEOUTs   OnInit(    (   s   selfs
   TimerAgent(    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   App‘  s   		s   redirect(   s   banners   selfs   _banners   starts   wxs	   MiniFrames
   TimerAgents   Apps   Falses   apps   wx_mainloops   join(   s   selfs   sys_exits   banners
   TimerAgents   App(    (   s   selfs
   TimerAgents=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   mainloopv  s    	
"
(	   s   __name__s
   __module__s   __doc__s   TIMEOUTs   Nones   MTInteractiveShells   __init__s   wxexits   mainloop(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys	   IPShellWXA  s
    '	s	   IPShellQtc           B   sD   t  Z d  Z d Z e e e d e d „ Z d e d „ Z d „  Z RS(   sÙ   Run a Qt event loop in a separate thread.
    
    Python commands can be passed to the thread where they will be executed.
    This is implemented by periodically checking for passed code using a
    Qt timer / slot.id   i    c         C   st   d  k  } t ƒ  |  _ t ƒ  |  _ t | d | d | d | d | d | i i g ƒ|  _ t |  _ t i i |  ƒ d  S(   Ns   user_nss   user_global_nss   debugs   shell_classs   on_kill(   s   qts	   hijack_qts   selfs	   exec_loops   get_tks   tks   make_IPythons   argvs   user_nss   user_global_nss   debugs   shell_classs   qApps   exits   IPs   Nones   _banners	   threadings   Threads   __init__(   s   selfs   argvs   user_nss   user_global_nss   debugs   shell_classs   qt(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__©  s    		c         C   sÅ   d  k  } | |  _ | i i ƒ  o | i t i ƒ } n | i	 ƒ  |  _
 | i i |  i
 | i d ƒ |  i ƒ |  i ƒ  |  i
 i |  i t ƒ x( t o  |  i i o Pn |  i ƒ  q W|  i ƒ  d  S(   Ns	   timeout()(   s   qts   banners   selfs   _banners   QApplications
   startingUps   syss   argvs   as   QTimers   timers   QObjects   connects   SIGNALs   on_timers   starts   TIMEOUTs   Trues   IPs   _kills	   exec_loops   join(   s   selfs   sys_exits   banners   as   qt(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   mainloopÁ  s     		

  c         C   s:   t  |  i ƒ |  i i ƒ  } |  i i |  i t	 ƒ | Sd  S(   N(
   s	   update_tks   selfs   tks   IPs   runcodes   results   timers   starts   TIMEOUTs   True(   s   selfs   result(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   on_timerÖ  s    (	   s   __name__s
   __module__s   __doc__s   TIMEOUTs   Nones   MTInteractiveShells   __init__s   mainloops   on_timer(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys	   IPShellQt   s
    s
   IPShellQt4c           B   sD   t  Z d  Z d Z e e e d e d „ Z d e d „ Z d „  Z RS(   sÕ   Run a Qt event loop in a separate thread.

    Python commands can be passed to the thread where they will be executed.
    This is implemented by periodically checking for passed code using a
    Qt timer / slot.id   i    c         C   sÀ   d k  l } l } y | i ƒ  Wn t j
 o n X| i d j o t d ƒ n t ƒ  |  _	 t
 ƒ  |  _ t | d | d | d | d | d | i i g ƒ|  _ t |  _ t i i |  ƒ d  S(	   N(   s   QtCores   QtGuis   4.3s`   PyQt4 version 4.3 detected.
If you experience repeated threading warnings, please update PyQt4.
s   user_nss   user_global_nss   debugs   shell_classs   on_kill(   s   PyQt4s   QtCores   QtGuis   pyqtRemoveInputHooks   AttributeErrors   PYQT_VERSION_STRs   warns
   hijack_qt4s   selfs   exec_s   get_tks   tks   make_IPythons   argvs   user_nss   user_global_nss   debugs   shell_classs   qApps   exits   IPs   Nones   _banners	   threadings   Threads   __init__(   s   selfs   argvs   user_nss   user_global_nss   debugs   shell_classs   QtGuis   QtCore(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__æ  s"    	c         C   sÌ   d k  l } l } | |  _ | i i ƒ  o | i t i	 ƒ } n | i ƒ  |  _ | i i |  i | i d ƒ |  i ƒ |  i ƒ  |  i i |  i ƒ x( t o  |  i i o Pn |  i ƒ  q– W|  i ƒ  d  S(   N(   s   QtCores   QtGuis	   timeout()(   s   PyQt4s   QtCores   QtGuis   banners   selfs   _banners   QApplications
   startingUps   syss   argvs   as   QTimers   timers   QObjects   connects   SIGNALs   on_timers   starts   TIMEOUTs   Trues   IPs   _kills   exec_s   join(   s   selfs   sys_exits   banners   as   QtGuis   QtCore(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   mainloop	  s     	

  c         C   s7   t  |  i ƒ |  i i ƒ  } |  i i |  i ƒ | Sd  S(   N(	   s	   update_tks   selfs   tks   IPs   runcodes   results   timers   starts   TIMEOUT(   s   selfs   result(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   on_timer  s    (	   s   __name__s
   __module__s   __doc__s   TIMEOUTs   Nones   MTInteractiveShells   __init__s   mainloops   on_timer(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys
   IPShellQt4Ý  s
    #c         C   sG   t  i i ƒ  } | i i o' | i d ƒ | i i i	 | i
 ƒ n d S(   så   Allow users to disable pulling all of pylab into the top-level
    namespace.

    This little utility must be called AFTER the actual ipython instance is
    running, since only then will the options file have been fully parsed.s   from matplotlib.pylab import *N(   s   IPythons   ipapis   gets   ips   optionss   pylab_import_alls   exs   IPs   user_config_nss   updates   user_ns(   s   user_nss   ip(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   _load_pylab'  s
     s   IPShellMatplotlibc           B   s#   t  Z d  Z e e e d d „ Z RS(   sÈ   Subclass IPShell with MatplotlibShell as the internal shell.

    Single-threaded class, meant for the Tk* and FLTK* backends.

    Having this on a separate class simplifies the external driver code.i   c         C   s3   t  i |  | | | | d t ƒt |  i	 i ƒ d  S(   Ns   shell_class(
   s   IPShells   __init__s   selfs   argvs   user_nss   user_global_nss   debugs   MatplotlibShells   _load_pylabs   IP(   s   selfs   argvs   user_nss   user_global_nss   debug(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__;  s    
(   s   __name__s
   __module__s   __doc__s   Nones   __init__(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   IPShellMatplotlib4  s    s   IPShellMatplotlibGTKc           B   s#   t  Z d  Z e e e d d „ Z RS(   sy   Subclass IPShellGTK with MatplotlibMTShell as the internal shell.

    Multi-threaded class, meant for the GTK* backends.i   c         C   s3   t  i |  | | | | d t ƒt |  i	 i ƒ d  S(   Ns   shell_class(
   s
   IPShellGTKs   __init__s   selfs   argvs   user_nss   user_global_nss   debugs   MatplotlibMTShells   _load_pylabs   IP(   s   selfs   argvs   user_nss   user_global_nss   debug(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__E  s    
(   s   __name__s
   __module__s   __doc__s   Nones   __init__(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   IPShellMatplotlibGTK@  s    s   IPShellMatplotlibWXc           B   s#   t  Z d  Z e e e d d „ Z RS(   sw   Subclass IPShellWX with MatplotlibMTShell as the internal shell.

    Multi-threaded class, meant for the WX* backends.i   c         C   s3   t  i |  | | | | d t ƒt |  i	 i ƒ d  S(   Ns   shell_class(
   s	   IPShellWXs   __init__s   selfs   argvs   user_nss   user_global_nss   debugs   MatplotlibMTShells   _load_pylabs   IP(   s   selfs   argvs   user_nss   user_global_nss   debug(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__O  s    
(   s   __name__s
   __module__s   __doc__s   Nones   __init__(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   IPShellMatplotlibWXJ  s    s   IPShellMatplotlibQtc           B   s#   t  Z d  Z e e e d d „ Z RS(   sw   Subclass IPShellQt with MatplotlibMTShell as the internal shell.

    Multi-threaded class, meant for the Qt* backends.i   c         C   s3   t  i |  | | | | d t ƒt |  i	 i ƒ d  S(   Ns   shell_class(
   s	   IPShellQts   __init__s   selfs   argvs   user_nss   user_global_nss   debugs   MatplotlibMTShells   _load_pylabs   IP(   s   selfs   argvs   user_nss   user_global_nss   debug(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__Y  s    
(   s   __name__s
   __module__s   __doc__s   Nones   __init__(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   IPShellMatplotlibQtT  s    s   IPShellMatplotlibQt4c           B   s#   t  Z d  Z e e e d d „ Z RS(   sy   Subclass IPShellQt4 with MatplotlibMTShell as the internal shell.

    Multi-threaded class, meant for the Qt4* backends.i   c         C   s3   t  i |  | | | | d t ƒt |  i	 i ƒ d  S(   Ns   shell_class(
   s
   IPShellQt4s   __init__s   selfs   argvs   user_nss   user_global_nss   debugs   MatplotlibMTShells   _load_pylabs   IP(   s   selfs   argvs   user_nss   user_global_nss   debug(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   __init__c  s    
(   s   __name__s
   __module__s   __doc__s   Nones   __init__(    (    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   IPShellMatplotlibQt4^  s    c         C   sW  h  d t  <d t <d t <d t <d t <} h  d t <d t <d t <d t	 <d t
 <} h  d d <d d <d d <d d	 <d d
 <} t d d d d d d d g ƒ } t g  i }	 |  d  D] }
 |	 |
 i d d ƒ ƒ qÏ ~	 ƒ } | | @} d | j o t a | i d ƒ n d | j oí y d k } Wn! t j
 o t d ƒ t
 Sn X| i d ƒ | o! | i ƒ  } | | | i d <n| | i d } | i  d ƒ o
 d } nU | i  d ƒ o
 d } n; | i  d ƒ o
 d } n! | i  d ƒ o
 d } n d } | | Sn5 y | i ƒ  } Wn t! j
 o d } n X| | Sd S(   s  Select a shell from the given argv vector.

    This function implements the threading selection policy, allowing runtime
    control of the threading mode, both for general users and for matplotlib.

    Return:
      Shell class to be instantiated for runtime operation.
    s   gthreads   wthreads   qthreads   q4threads   tkthreads   GTKAggs   WXAggs   QtAggs   Qt4Aggs   TkAggs   tks   pylabi   s   -s    Ns;   matplotlib could NOT be imported!  Starting normal IPython.s   backends   GTKs   WXs   Qt4s   Qt("   s   IPShellMatplotlibGTKs   IPShellMatplotlibWXs   IPShellMatplotlibQts   IPShellMatplotlibQt4s   IPShellMatplotlibs	   mpl_shells
   IPShellGTKs	   IPShellWXs	   IPShellQts
   IPShellQt4s   IPShells   th_shells   backendss   sets   all_optss   appends   _[1]s   argvs   ss   replaces	   user_optss   special_optss   Trues   USE_TKs   removes
   matplotlibs   ImportErrors   errors   pops   th_modes   rcParamss   backends
   startswiths   KeyError(   s   argvs	   mpl_shells   all_optss   backends   special_optss   backendss	   user_optss
   matplotlibs   th_modes   _[1]s   ss   th_shell(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   _select_shellk  sJ      333!=

	



c         C   s    t  t i ƒ } | d |  ƒ Sd S(   s#  Return a running shell instance, dealing with threading options.

    This is a factory function which will instantiate the proper IPython shell
    based on the user's threading choice.  Such a selector is needed because
    different GUI toolkits require different thread handling details.s   user_nsN(   s   _select_shells   syss   argvs   shells   user_ns(   s   user_nss   shell(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   start¼  s     (Q   s   __doc__s   IPythons   Releases   authorss
   __author__s   licenses   __license__s   __builtin__s   __main__s   Queues   inspects   oss   syss   threads	   threadings   times   signals   SIGINTs   ctypess   Trues
   HAS_CTYPESs   ImportErrors   Falses   ultraTBs   ipapis   IPython.genutilss   Terms   warns   errors
   flag_callss
   ask_yes_nos   IPython.iplibs   InteractiveShells   IPython.ipmakers   make_IPythons   IPython.Magics   Magics   IPython.ipstructs   Structs   sets	   NameErrors   setss   Sets   KBINTs   USE_TKs	   get_idents   MAIN_THREAD_IDs   Nones   CODE_RUNs   IPShells   kill_embeddeds   IPShellEmbeds   _async_raises   sigint_handlers   MTInteractiveShells   MatplotlibShellBases   MatplotlibShells   MatplotlibMTShells   get_tks	   hijack_tks	   update_tks	   hijack_wxs
   hijack_gtks	   hijack_qts
   hijack_qt4s   Threads   IPThreads
   IPShellGTKs	   IPShellWXs	   IPShellQts
   IPShellQt4s   _load_pylabs   IPShellMatplotlibs   IPShellMatplotlibGTKs   IPShellMatplotlibWXs   IPShellMatplotlibQts   IPShellMatplotlibQt4s   _select_shells   starts   IPythonShells   IPythonShellEmbed(>   s   MAIN_THREAD_IDs   sets   Structs   _load_pylabs
   IPShellGTKs   get_tks   __builtin__s
   hijack_qt4s   __main__s   IPythons
   HAS_CTYPESs   IPShellMatplotlibQt4s   MatplotlibShells   kill_embeddeds   errors   _async_raises   starts   IPShellMatplotlibQts   MatplotlibMTShells   MTInteractiveShells   SIGINTs   IPShellMatplotlibs   IPThreads	   IPShellWXs   MatplotlibShellBases   make_IPythons   IPShells   IPShellMatplotlibWXs	   hijack_tks   _select_shells   Terms   Magics   __license__s	   update_tks   inspects   IPShellEmbeds
   __author__s   syss	   hijack_wxs   ctypess
   flag_callss	   IPShellQts   Releases   ultraTBs   Queues   threads   setss   ipapis   signals	   hijack_qts
   IPShellQt4s   IPShellMatplotlibGTKs   warns	   threadings   IPythonShells
   hijack_gtks   times   sigint_handlers   IPythonShellEmbeds   oss   InteractiveShells
   ask_yes_no(    (    s=   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/Shell.pys   ?   s†   												
	%	¿		j								P_=J	


	Q