Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#30 Extension to CallTips / Show attributes

open-accepted
None
5
2014-08-25
2003-01-10
Martin Liebmann
No

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

Discussion

  • Kurt B. Kaiser
    Kurt B. Kaiser
    2003-01-12

    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

     
    Attachments
  • Kurt B. Kaiser
    Kurt B. Kaiser
    2003-01-14

    • assigned_to: nobody --> kbk
    • status: open --> open-duplicate
     
  • Kurt B. Kaiser
    Kurt B. Kaiser
    2003-01-14

    • status: open-duplicate --> open-accepted
     
  • context diff for CallTips.py

     
  • Kurt B. Kaiser
    Kurt B. Kaiser
    2003-01-20

    • status: open-accepted --> open-postponed
     
  • Kurt B. Kaiser
    Kurt B. Kaiser
    2003-01-20

    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

     
    Attachments
  • Logged In: YES
    user_id=475133

    The new patches will patch the problems reported by kbk

     
  • Kurt B. Kaiser
    Kurt B. Kaiser
    2003-01-27

    • status: open-postponed --> open-accepted
     
  • Kurt B. Kaiser
    Kurt B. Kaiser
    2003-01-27

    Logged In: YES
    user_id=149084

    Remove duplicate uploads.

    Thanks for the updates!