[IPython-dev] Question about custom completer behavior: terminal vs qt app

Darren Dale dsdale24@gmail....
Mon Mar 12 10:19:49 CDT 2012


Sorry, here is the attachment.


On Mon, Mar 12, 2012 at 11:15 AM, Darren Dale <dsdale24@gmail.com> wrote:
> Hi All,
>
> I maintain a custom completer for the h5py project. The h5py objects
> have a dict-like interface, and the completer supports the following:
>
> In  [1]: import h5py
> In  [2]: f=h5py.File('foo.h5')
> In  [3]: f['<tab>
> 1
> In  [3]: f['1'].<tab>
> f['1'].attrs            f['1'].items            f['1'].ref
> f['1'].copy             f['1'].iteritems        f['1'].require_dataset
> f['1'].create_dataset   f['1'].iterkeys         f['1'].require_group
> f['1'].create_group     f['1'].itervalues       f['1'].values
> f['1'].file             f['1'].keys             f['1'].visit
> f['1'].get              f['1'].name             f['1'].visititems
> f['1'].id               f['1'].parent
>
>
> If I try to do the same with ipython-qtconsole, tab completion works
> for the keys, but the attribute completer does not yield a list of
> attributes. The attribute completer acts like there are no possible
> matches, even the h5py_attr_completer is returning the following list:
>
> [u"f['1'].attrs", u"f['1'].copy", u"f['1'].create_dataset",
> u"f['1'].create_group", u"f['1'].file", u"f['1'].get", u"f['1'].id",
> u"f['1'].items", u"f['1'].iteritems", u"f['1'].iterkeys",
> u"f['1'].itervalues", u"f['1'].keys", u"f['1'].name",
> u"f['1'].parent", u"f['1'].ref", u"f['1'].require_dataset",
> u"f['1'].require_group", u"f['1'].values", u"f['1'].visit",
> u"f['1'].visititems"]
> [u"f['1'].attrs", u"f['1'].copy", u"f['1'].create_dataset",
> u"f['1'].create_group", u"f['1'].file", u"f['1'].get", u"f['1'].id",
> u"f['1'].items", u"f['1'].iteritems", u"f['1'].iterkeys",
> u"f['1'].itervalues", u"f['1'].keys", u"f['1'].name",
> u"f['1'].parent", u"f['1'].ref", u"f['1'].require_dataset",
> u"f['1'].require_group", u"f['1'].values", u"f['1'].visit",
> u"f['1'].visititems"]
>
> I guess my question is, is this a bug, or do I need to take a
> different approach?
>
> Thanks,
> Darren
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipy_completer.py
Type: application/octet-stream
Size: 4058 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/ipython-dev/attachments/20120312/bbab13b7/attachment.obj 


More information about the IPython-dev mailing list