<div class="gmail_quote">On Tue, Feb 3, 2009 at 9:03 AM, Darren Dale <span dir="ltr"><<a href="mailto:dsdale24@gmail.com">dsdale24@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><div class="gmail_quote"><div><div></div><div class="Wj3C7c">On Mon, Feb 2, 2009 at 4:06 PM, Darren Dale <span dir="ltr"><<a href="mailto:dsdale24@gmail.com" target="_blank">dsdale24@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div><div></div><div>On Mon, Feb 2, 2009 at 8:07 AM, Ville M. Vainio <span dir="ltr"><<a href="mailto:vivainio@gmail.com" target="_blank">vivainio@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On Sun, Feb 1, 2009 at 2:13 AM, Darren Dale <<a href="mailto:dsdale24@gmail.com" target="_blank">dsdale24@gmail.com</a>> wrote:<br>
<br>
> Thank you for the advice. I've been looking at this most of the day, and I<br>
> think I'm stuck. I have an object I'm trying to navigate:<br>
<br>
</div><div>> It's not clear to me how I would get the object at level_3 and then hook<br>
> into ipython's usual completion chain to filter attributes with leading<br>
> underscores, or the traits completer, for example. Is this possible?<br>
<br>
</div>You just need to eval the whole thing, and see what attributes that<br>
eval'ed object has. That's what I did in ipy_greedycompleter. It's<br>
sort of "complete at your own risk" scheme, but it's the best thing<br>
you can get without putting in lots of work (and it will do what you<br>
want anyhow). The only work you need to do is determine how much you<br>
need to eval (here, it's everything before period).<br>
<font color="#888888"><br></font></blockquote></div></div><div><br>Thanks for the suggestion. Once I determine how much to eval, do you know if it is possible to hook back into the standard completer pipeline to benefit from things like ipy_traits_completer? </div>

</div></blockquote></div></div><div><br>I'd like to make a suggestion for the regular expression in the greedy completer. Prepending  r"(?:.*\=+)?" should allow you to do things like:<br><br>a=b=''.att<tab><br>

<br>since it won't include a=b= in the match.<br><br>I'm making progress on a custom completer for a dict-like object that doesnt call arbitrary functions (regular expressions are a pain to relearn, but they are incredibly useful). I'll share what I have as soon as I tie what I have together.<br>

</div></div></blockquote><div><br><br>
I am nearly finished with this project, I'm just having trouble evaluating doing the following:<br>
<br>
d={'test':'ok'}<br>
a={'nested':d}<br>
<br>
a['nes<tab><br>
<br>
yields:<br>
<br>
a['nested'<br>
<br>
I'd like it to yield <br>
<br>
a['nested']<br>
<br>
but thats a minor point. A major sticking point is:<br>
<br>
a['nested'].ite<tab><br>
<br>
That doesnt yield anything, but I know that a list of possible
completions is being generated, I can print the list in my completer,
but its not propagating back to ipython for some reason. Could someone
please have a look? Its easy to try it, just drop it in your ~/.ipython
directory and add this to ~/.ipython/ipy_user_conf.main:<br>
<br>
from ipy_h5py_completer import activate<br>
activate()<br>
<br>
I know it says h5py, but it works on plain old dictionaries for now.<br>
<br>
Thanks,<br>
Darren <br></div></div>