;ò
ÎÑAHc           @   sC   d  Z  d k l Z l Z d k l Z d „  Z d „  Z e ƒ  d S(   sp   Greedy completer extension for IPython

Normal tab completer refuses to evaluate nonsafe stuff. This will evaluate
everything, so you need to consider the consequences of pressing tab 
yourself!

Note that this extension simplifies readline interaction by setting
only whitespace as completer delimiter. If this works well, we will
do the same in default completer.

(   s   genericss   ipapi(   s   dir2c         C   sj  d k  } d }	 | i d | ƒ } | o | i d d ƒ \ } } nN |	 o g  Sn | i d |  i	 ƒ } | o g  Sn | i d d ƒ \ } } y t | |  i ƒ } Wn+ y t | |  i ƒ } WqÕ g  SqÕ Xn Xt | ƒ } y t i | | ƒ } Wn t i j
 o n Xt | ƒ } g  i } | D]/ }
 |
 |  | j o | d | |
 f ƒ q*q*~ } | Sd S(   sþ  Compute matches when text contains a dot.

    MONKEYPATCHED VERSION (ipy_greedycompleter.py)
    
    Assuming the text is of the form NAME.NAME....[NAME], and is
    evaluatable in self.namespace or self.global_namespace, it will be
    evaluated and its attributes (as revealed by dir()) are used as
    possible completions.  (For class instances, class members are are
    also considered.)

    WARNING: this can still invoke arbitrary C code, if an object
    with a __getattr__ hook is evaluated.

    Ni   s   (\S+(\.\w+)*)\.(\w*)$i   s   (.+)\.(\w*)$i   s   %s.%s(   s   res   force_completes   matchs   texts   ms   groups   exprs   attrs   selfs   lbufs   m2s   evals	   namespaces   objs   global_namespaces   dir2s   wordss   genericss   complete_objects   ipapis   TryNexts   lens   ns   appends   _[1]s   ws   res(   s   selfs   texts   objs   attrs   m2s   ms   exprs   _[1]s   res   force_completes   ws   ress   ns   words(    (    sW   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_greedycompleter.pys   attr_matches   s6     	Fc          C   s2   d  k  } | i d ƒ d  k }  t |  i i _ d  S(   Ns    
	(   s   readlines   set_completer_delimss   IPython.completers   IPythons   attr_matchess	   completers	   Completer(   s   IPythons   readline(    (    sW   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_greedycompleter.pys   mainD   s    		N(   s   __doc__s   IPythons   genericss   ipapis   IPython.genutilss   dir2s   attr_matchess   main(   s   dir2s   mains   ipapis   genericss   attr_matches(    (    sW   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_greedycompleter.pys   ?   s
   	5	