Kaydet (Commit) 908aece9 authored tarafından Kurt B. Kaiser's avatar Kurt B. Kaiser

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
üst e72f05d5
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# displays parameter information as you open parens. # displays parameter information as you open parens.
import string import string
import sys
import types import types
class CallTips: class CallTips:
...@@ -128,16 +127,21 @@ def get_arg_text(ob): ...@@ -128,16 +127,21 @@ def get_arg_text(ob):
items.append("...") items.append("...")
if fob.func_code.co_flags & 0x8: if fob.func_code.co_flags & 0x8:
items.append("***") items.append("***")
argText = string.join(items , ", ") argText = ", ".join(items)
argText = "(%s)" % argText argText = "(%s)" % argText
except: except:
pass pass
# See if we can use the docstring # See if we can use the docstring
if hasattr(ob, "__doc__") and ob.__doc__: doc = getattr(ob, "__doc__", "")
pos = string.find(ob.__doc__, "\n") if doc:
if pos<0 or pos>70: pos=70 while doc[:1] in " \t\n":
if argText: argText = argText + "\n" doc = doc[1:]
argText = argText + ob.__doc__[:pos] pos = doc.find("\n")
if pos < 0 or pos > 70:
pos = 70
if argText:
argText += "\n"
argText += doc[:pos]
return argText return argText
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment