[Idle-dev] CVS: idle CallTips.py,1.5,1.6

Kurt B. Kaiser kbk@users.sourceforge.net
Sun, 15 Sep 2002 15:03:00 -0700


Update of /cvsroot/idlefork/idle
In directory usw-pr-cvs1:/tmp/cvs-serv5999

Modified Files:
	CallTips.py 
Log Message:
Merge Py Idle changes
Rev 1.9
Improve handling of docstrings.  I had feared this was a case of
introspection incompatibility, but in fact it's just that calltips
always gave up on a docstring that started with a newline (but
didn't realize they were giving up <wink>).

Rev 1.10
(already merged)

Rev 1.11
(whitespace normalization, skip this time)

Rev 1.12
Remove unnecessary imports


Index: CallTips.py
===================================================================
RCS file: /cvsroot/idlefork/idle/CallTips.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** CallTips.py	14 Sep 2002 00:55:21 -0000	1.5
--- CallTips.py	15 Sep 2002 22:02:58 -0000	1.6
***************
*** 3,7 ****
  
  import string
- import sys
  import types
  
--- 3,6 ----
***************
*** 129,142 ****
                  if fob.func_code.co_flags & 0x8:
                      items.append("***")
!                 argText = string.join(items , ", ")
                  argText = "(%s)" % argText
              except:
                  pass
          # See if we can use the docstring
!         if hasattr(ob, "__doc__") and ob.__doc__:
!             pos = string.find(ob.__doc__, "\n")
!             if pos<0 or pos>70: pos=70
!             if argText: argText = argText + "\n"
!             argText = argText + ob.__doc__[:pos]
  
      return argText
--- 128,146 ----
                  if fob.func_code.co_flags & 0x8:
                      items.append("***")
!                 argText = ", ".join(items)
                  argText = "(%s)" % argText
              except:
                  pass
          # See if we can use the docstring
!         doc = getattr(ob, "__doc__", "")
!         if doc:
!             while doc[:1] in " \t\n":
!                 doc = doc[1:]
!             pos = doc.find("\n")
!             if pos < 0 or pos > 70:
!                 pos = 70
!             if argText:
!                 argText += "\n"
!             argText += doc[:pos]
  
      return argText