;ò
ÎÑAHc           @   s[   d  Z  d k l Z d e i d Z e i Z d „  Z d k l	 Z	 e e	 _
 [	 [ d GHd S(   sc  Modified input prompt for entering quantities with units.

Modify the behavior of the interactive interpreter to allow direct input of
quantities with units without having to make a function call.

Now the following forms are accepted:

x = 4 m
y = -.45e3 m/s
g = 9.8 m/s**2
a = 2.3 m/s^2   # ^ -> ** automatically

All other input is processed normally.
(   s   Releases   %s <%s>s   Fernandoc   	      C   s¥   d k  l } d k l } | d | ƒ } | o^ | i ƒ  \ } } } | o | o | o0 | i
 d d ƒ } | d | d | d } qŽ n | i |  | | ƒ Sd	 S(
   sž   Alternate prefilter for input of PhysicalQuantityInteractive objects.

    This assumes that the function PhysicalQuantityInteractive() has been
    imported.(   s   match(   s   InteractiveShells5   \s*(\w+)\s*=\s*(-?\d*\.?\d*[eE]?-?\d*)\s+([a-zA-Z].*)s   ^s   **s    = PhysicalQuantityInteractive(s   , 's   ')N(   s   res   matchs   IPython.iplibs   InteractiveShells   lines
   unit_splits   groupss   vars   vals   unitss   replaces
   _prefilters   selfs   continuation(	   s   selfs   lines   continuations   vals
   unit_splits   unitss   vars   InteractiveShells   match(    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/PhysicalQInput.pys   prefilter_PQ/   s     	"(   s   InteractiveShells5   *** Simplified input for physical quantities enabled.N(   s   __doc__s   IPythons   Releases   authorss
   __author__s   licenses   __license__s   prefilter_PQs   IPython.iplibs   InteractiveShells	   prefilter(   s   Releases   prefilter_PQs   InteractiveShells   __license__s
   __author__(    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/PhysicalQInput.pys   ?   s   			