[Idle-dev] [ idlefork-Patches-665943 ] Extension to CallTips / Show attributes
SourceForge.net
noreply@sourceforge.net
Sun, 26 Jan 2003 13:13:42 -0800
Patches item #665943, was opened at 2003-01-10 20:28
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=309579&aid=665943&group_id=9579
Category: None
Group: None
Status: Open
Resolution: Postponed
Priority: 5
Submitted By: Martin Liebmann (mliebmann)
Assigned to: Kurt B. Kaiser (kbk)
Summary: Extension to CallTips / Show attributes
Initial Comment:
This is a new version of an extension to CallTips
showing on the fly attributes and methods of an object.
This proposal is based on IDLEfork 0.9a1 (and Python
2.2) .
Three files have to be modified :
CallTips.py
CallTipWindow.py and
config-extensions.def.
New features:
Hitting a dot will display all available attributes and
methods of an object within a scrollable box. (apart from
names beginning with __ )
Key-Up and Key-Down events support scrolling.
Further Key event will reduce the proposed names
according to the substring written to the text widget.
Hitting the Space-Key will copy the topmost item of the
list to the Editor or Console window.
... A usefull extension for python beginners !
Greetings
Martin Liebmann
Attached (as zip archive):
CallTips.py.unified.diff
CallTipWindow.py.unified.diff
config-extensions.def.unified.diff
----------------------------------------------------------------------
>Comment By: Martin Liebmann (mliebmann)
Date: 2003-01-26 21:13
Message:
Logged In: YES
user_id=475133
The new patches will patch the problems reported by kbk
----------------------------------------------------------------------
Comment By: Kurt B. Kaiser (kbk)
Date: 2003-01-20 22:48
Message:
Logged In: YES
user_id=149084
I think this patch could use some addtional work before
it's really ready for prime time:
import StringIO
StringIO.StringIO. [produces a list of class StringIO
attributes. Useful, but
unexpected
to be produced at the class
level.
>>> s = StringIO.StringIO
>>> s
<class StringIO.StringIO at 0x402df3bc>
>>> s. [doesn't produce a list of
attributes, as would be expected
for the instance.]
>>> ================================ RESTART =========
>>> from StringIO import *
>>> StringIO
<class StringIO.StringIO at 0x402df3bc>
>>> StringIO. [produces the list of classes and
top level defs associated with the
StringIO module]
>>> ================================ RESTART =========
>>> class Animal:
def __init__(self, numberlegs, sound=None):
self.nlegs = numberlegs
self.sound = sound
def legs(self, numberlegs=None):
if numberlegs == None:
print self.nlegs
else:
self.nlegs = numberlegs
def sound(self):
print sound
--------------
>>> dog = Animal. [doesn't produce a list of
attributes]
>>> dog = Animal( [produces the expected call tip]
----------------
>>> dog = Animal(4, 'bark')
>>> dog
<__main__.Animal instance at 0x404dd42c>
>>> dog. [doesn't produce a list of
attributes. Generally can't
see attributes for Classes
defined in shell for some reason.]
[define Animal in efoo.py]
>>> ================================ RESTART ========
>>> import efoo
---------------------
>>> efoo. [produces a list of efoo.py Classes
and top-level defs]
----------------------
>>> efoo.Animal. [produces list of Animal attributes]
----------------------
>>> dog = efoo.Animal(4, 'bark')
>>> dog
<efoo.Animal instance at 0x405489ac>
>>> dog. [doesn't produce list of attributes.]
----------------------------------------------------------------------
Comment By: Kurt B. Kaiser (kbk)
Date: 2003-01-12 18:27
Message:
Logged In: YES
user_id=149084
Will you be able to upload the patch file?
BTW, we prefer context diffs over unidiffs when possible.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=309579&aid=665943&group_id=9579