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
Logged In: YES
user_id=149084
Will you be able to upload the patch file?
BTW, we prefer context diffs over unidiffs when possible.
zipped tar archive of 3 context diffs
context diff for CallTips.py
context diff for CallTipWindow.py
context diff for config-extensions.def
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.]
Patched version
Patched version
Logged In: YES
user_id=475133
The new patches will patch the problems reported by kbk
Logged In: YES
user_id=149084
Remove duplicate uploads.
Thanks for the updates!