;ò
ÎÑAHc           @   sZ   d  k  l Z d k  Z d k Z d e f d „  ƒ  YZ d „  Z e d j o e ƒ  n d S(   (   s   CommandChainDispatcherNs   StrDispatchc           B   sS   t  Z d  Z d „  Z d d „ Z d d „ Z d „  Z d „  Z d „  Z d „  Z	 RS(	   s8    Dispatch (lookup) a set of strings / regexps for match c         C   s   h  |  _ h  |  _ d  S(   N(   s   selfs   strss   regexs(   s   self(    (    sC   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/strdispatch.pys   __init__   s    	i    c         C   s9   |  i i | t ƒ  ƒ } | i | | ƒ | |  i | <d S(   s(    Adds a target 'string' for dispatching N(	   s   selfs   strss   gets   ss   CommandChainDispatchers   chains   adds   objs   priority(   s   selfs   ss   objs   prioritys   chain(    (    sC   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/strdispatch.pys   add_s   s     c         C   s9   |  i i | t ƒ  ƒ } | i | | ƒ | |  i | <d S(   s&    Adds a target regexp for dispatching N(	   s   selfs   regexss   gets   regexs   CommandChainDispatchers   chains   adds   objs   priority(   s   selfs   regexs   objs   prioritys   chain(    (    sC   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/strdispatch.pys   add_re   s     c         c   s^   | |  i j o |  i | Vn x8 |  i i ƒ  D]' \ } } t i | | ƒ o | Vq/ q/ Wd S(   s2    Get a seq of Commandchain objects that match key N(	   s   keys   selfs   strss   regexss   itemss   rs   objs   res   match(   s   selfs   keys   rs   obj(    (    sC   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/strdispatch.pys   dispatch   s      c         C   s   d |  i |  i f Sd  S(   Ns   <Strdispatch %s, %s>(   s   selfs   strss   regexs(   s   self(    (    sC   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/strdispatch.pys   __repr__&   s    c         c   s<   | |  i j o d  Sn x |  i | D] } | d Vq& Wd  S(   Ni   (   s   keys   selfs   strss   el(   s   selfs   keys   el(    (    sC   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/strdispatch.pys	   s_matches)   s
     c         c   s;   x0 |  i | ƒ D] } x | D] } | d Vq Wq Wd Sd S(   s-    Yield all 'value' targets, without priority i   N(   s   selfs   dispatchs   keys   vals   el(   s   selfs   keys   els   val(    (    sC   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/strdispatch.pys   flat_matches0   s       (
   s   __name__s
   __module__s   __doc__s   __init__s   add_ss   add_res   dispatchs   __repr__s	   s_matchess   flat_matches(    (    (    sC   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/strdispatch.pys   StrDispatch   s    				c          C   sq   t  ƒ  }  |  i d d d d ƒ|  i d d d d ƒt |  i d ƒ ƒ GH|  i d d ƒ t |  i d ƒ ƒ GHd  S(	   Ns   heii"   s   priorityi   i{   i   s   h.ii®  (   s   StrDispatchs   ds   add_ss   lists   dispatchs   add_res   flat_matches(   s   d(    (    sC   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/strdispatch.pys   test8   s    	s   __main__(   s   IPython.hookss   CommandChainDispatchers   IPythons   res   objects   StrDispatchs   tests   __name__(   s   res   tests   CommandChainDispatchers   IPythons   StrDispatch(    (    sC   /nyx/web/d/b/dbachman/work/src/ipython-0.8.4/IPython/strdispatch.pys   ?   s   		2	