;ò

�ü?c           @   s  d  Z  d k Z d k Z d k Z d k Z d k Z d f  d „  ƒ  YZ d „  Z d „  Z e	 d j o® d „  Z
 e d „ Z d	 „  Z d
 „  Z d „  Z e d „ Z d f  d „  ƒ  YZ d „  Z e ƒ  Z e
 e e e e e e e i
 e i e i e i e i e i f Z e e ƒ n d S(   sP  CallTips.py - An IDLE Extension to Jog Your Memory

Call Tips are floating windows which display function, class, and method
parameter and docstring information when you type an opening parenthesis, and
which disappear when you type a closing parenthesis.

Future plans include extending the functionality to include class attributes.

Ns   CallTipsc           B   sˆ   t  Z g  Z e d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d	 e i e i Z d
 „  Z d „  Z d „  Z RS(   Nc         C   sL   | t j o t |  _  d  Sn | |  _  | i |  _ t |  _ |  i |  _ d  S(   N(   s   editwins   Nones   selfs   texts   calltips   _make_tk_calltip_windows   _make_calltip_window(   s   selfs   editwin(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   __init__   s    			c         C   s   t  |  _ d  S(   N(   s   Nones   selfs   _make_calltip_window(   s   self(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   close    s    c         C   s   t  i |  i ƒ Sd  S(   N(   s   CallTipWindows   CallTips   selfs   text(   s   self(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   _make_tk_calltip_window#   s    c         C   s(   |  i o |  i i ƒ  t |  _ n d  S(   N(   s   selfs   calltips   hidetips   None(   s   self(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   _remove_calltip_window'   s    
c         C   sl   |  i ƒ  |  i ƒ  } |  i | ƒ } | o8 |  i i d ƒ |  _ |  i	 ƒ  |  _
 |  i
 i | ƒ n d Sd  S(   Ns   inserts    (   s   selfs   _remove_calltip_windows   get_name_at_cursors   names	   fetch_tips   arg_texts   texts   indexs   calltip_starts   _make_calltip_windows   calltips   showtip(   s   selfs   events   arg_texts   name(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   paren_open_event,   s    
c         C   s   |  i ƒ  d Sd  S(   Ns    (   s   selfs   _remove_calltip_window(   s   selfs   event(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   paren_close_event6   s    
c         C   s`   |  i oN |  i i d d |  i ƒ p |  i i d d |  i d ƒ o |  i ƒ  qX n d Sd  S(   Ns   inserts   <=s   >s    lineends    (   s   selfs   calltips   texts   compares   calltip_starts   _remove_calltip_window(   s   selfs   event(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   check_calltip_cancel_event<   s    
<c         C   s   |  i ƒ  d Sd  S(   Ns    (   s   selfs   _remove_calltip_window(   s   selfs   event(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   calltip_cancel_eventG   s    
s   ._c         C   sd   |  i } |  i i d d ƒ } t | ƒ } x+ | o | | d | j o | d 8} q- W| | Sd  S(   Ns   insert linestarts   inserti   (   s   selfs   _CallTips__IDCHARSs   idcharss   texts   gets   strs   lens   i(   s   selfs   is   idcharss   str(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   get_name_at_cursorM   s    	 c         C   sj   y |  i i i i i } Wn t } n X| o | i d d | f h  ƒ Sn |  i	 | ƒ } t | ƒ Sd S(   s
  Return the argument list and docstring of a function or class

        If there is a Python subprocess, get the calltip there.  Otherwise,
        either fetch_tip() is running in the subprocess itself or it was called
        in an IDLE EditorWindow before any script had been run.

        The subprocess environment is that of the most recently run script.  If
        two unrelated modules are being edited some calltips in the current
        module may be inoperative if the module was not the last to run.

        s   execs   get_the_calltipN(   s   selfs   editwins   flists   pyshells   interps   rpcclts   Nones
   remotecalls   names
   get_entitys   entitys   get_arg_text(   s   selfs   names   rpcclts   entity(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys	   fetch_tipU   s     
c         C   sM   | oB t i i ƒ  } | i t i ƒ y t | | ƒ SWqI t	 SqI Xn d S(   sA   Lookup name in a namespace spanning sys.modules and __main.dict__N(
   s   names   syss   moduless   copys	   namespaces   updates   __main__s   __dict__s   evals   None(   s   selfs   names	   namespace(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys
   get_entityl   s     (   s   __name__s
   __module__s   menudefss   Nones   __init__s   closes   _make_tk_calltip_windows   _remove_calltip_windows   paren_open_events   paren_close_events   check_calltip_cancel_events   calltip_cancel_events   strings   ascii_letterss   digitss   _CallTips__IDCHARSs   get_name_at_cursors	   fetch_tips
   get_entity(    (    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   CallTips   s   					
					c         C   sa   y |  i i SWnH t j
 o< x7 |  i D]' } t | ƒ } | t j	 o | Sq) q) Wn Xt Sd  S(   N(	   s   class_obs   __init__s   im_funcs   AttributeErrors	   __bases__s   bases   _find_constructors   rcs   None(   s   class_obs   bases   rc(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   _find_constructorv   s    
  c   	      C   s  d } |  t j	 od } t |  ƒ t i j o0 t |  ƒ } | t j o d „  } qŽ d } n0 t |  ƒ t i	 j o |  i
 } d } n |  } t | ƒ t i t i g j oæ yØ | i i | | i i !} | i p g  } t t d „  | ƒ ƒ } d g t | ƒ t | ƒ | } t d „  | | ƒ } | i i d @o | i d ƒ n | i i d	 @o | i d
 ƒ n d i | ƒ } d | } Wq“q“Xn t |  d d ƒ } | of | i ƒ  } | i d ƒ } | d j  p
 | d j o
 d } n | o | d 7} n | | |  7} qn | Sd S(   s:   Get a string describing the arguments for the given objects    i    c           C   s   t  S(   N(   s   None(    (    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   <lambda>Š   s    i   c         C   s   d |  S(   Ns   =%s(   s   name(   s   name(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   <lambda>™   s    c         C   s   |  | S(   N(   s   args   dflt(   s   args   dflt(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   <lambda>›   s    i   s   ...i   s   ***s   , s   (%s)s   __doc__s   
iF   N(   s   argTexts   obs   Nones	   argOffsets   types   typess	   ClassTypes   _find_constructors   fobs
   MethodTypes   im_funcs   FunctionTypes
   LambdaTypes	   func_codes   co_varnamess   co_argcounts   realArgss   func_defaultss   defaultss   lists   maps   lens   itemss   co_flagss   appends   joins   getattrs   docs   lstrips   finds   pos(	   s   obs   defaultss   itemss   poss   realArgss	   argOffsets   argTexts   fobs   doc(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   get_arg_text�   sL     
	
!
s   __main__c           C   s   d S(   s   ()N(    (    (    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   t1¶   s    c         C   s   d S(   s   (a, b=None)N(    (   s   as   b(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   t2·   s    c         G   s   d S(   s   (a, ...)N(    (   s   as   args(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   t3¸   s    c          G   s   d S(   s   (...)N(    (   s   args(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   t4¹   s    c         G   s   d S(   s   (a, ...)N(    (   s   as   args(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   t5º   s    c         O   s   d S(   s   (a, b=None, ..., ***)N(    (   s   as   bs   argss   kw(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   t6»   s    s   TCc           B   sV   t  Z d  Z e d „ Z d „  Z e d „ Z d „  Z d „  Z d „  Z	 e d „ Z
 RS(   s   (a=None, ...)c         G   s   d S(   s   (a=None, ...)N(    (   s   selfs   as   b(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   __init__¿   s    c         C   s   d S(   s   ()N(    (   s   self(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   t1À   s    c         C   s   d S(   s   (a, b=None)N(    (   s   selfs   as   b(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   t2Á   s    c         G   s   d S(   s   (a, ...)N(    (   s   selfs   as   args(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   t3Â   s    c         G   s   d S(   s   (...)N(    (   s   selfs   args(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   t4Ã   s    c         G   s   d S(   s   (a, ...)N(    (   s   selfs   as   args(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   t5Ä   s    c         O   s   d S(   s   (a, b=None, ..., ***)N(    (   s   selfs   as   bs   argss   kw(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   t6Å   s    (   s   __name__s
   __module__s   __doc__s   Nones   __init__s   t1s   t2s   t3s   t4s   t5s   t6(    (    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   TC½   s    				c         C   s¡   t  ƒ  } g  } xp |  D]h } | i d | i } | i } | i	 | ƒ } | | j o) | i | ƒ d | | t t ƒ f GHq q Wd t | ƒ t |  ƒ f GHd  S(   Ns   
s   %s - expected %s, but got %ss   %d of %d tests failed(   s   CallTipss   cts   faileds   testss   ts   __doc__s   expecteds   __name__s   names	   fetch_tips   arg_texts   appends   get_arg_texts   entitys   len(   s   testss   names   faileds   ts   arg_texts   expecteds   ct(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   testÇ   s    	 	 (   s   __doc__s   syss   strings   typess   CallTipWindows   __main__s   CallTipss   _find_constructors   get_arg_texts   __name__s   t1s   Nones   t2s   t3s   t4s   t5s   t6s   TCs   tests   tcs   tests(   s   strings   CallTipss   t6s   t4s   t5s   t2s   t3s   t1s   syss   tcs   testss   _find_constructors   __main__s   tests   CallTipWindows   TCs   typess   get_arg_text(    (    s-   /mit/python/lib/python2.3/idlelib/CallTips.pys   ?	   s(   					d		3				
		?