On Wed, 2007-21-11 at 10:31 -0800, bruce wrote: > len(list(showlinks()))
Thank Bruce, I knew about that trick ( I mentioned flattening the generator ), I just thought the command reference of the docs should correctly indicate what is returned ( Generator not list ), or it should return an object implementing the remaining list interfaces ( len, [] ). As it is, one of the first things I tried was to get the link object by subscripting with [] and the length with len, and then had to go and figure out in the shell why that didn't work. Minor inconvenience, but still a less than optimal user experience that could be avoided by a quick correction in the docs. Thanks for the hard work Titus! I'm really looking forward to the growth of Twill, it's great to have one tool I can use for simple automated browsing with or without the test harness. =) Iain > > On Wed, Nov 21, 2007 at 12:54:14AM -0800, iain duncan wrote: > > Hi all, just getting into Twill and I can see it will be great for > > functional testing my TG apps. > > > > I assume this is the place for bug reports and feature requests? > > > > Something I found: > > > > The command reference at > > http://twill.idyll.org/commands.html > > says that when called from python, showlinks and showforms return lists. > > However, in my shell, they seem to be returning generators that won't > > let me do: > > > > len( showlinks() ) > > > > I think it would be handly to be able to count them, but of course I can > > flatten the generator. However, thought I'd point out that doc mismatch > > and it might be nice to avoid the explicit conversion to list. > > > > > > BTW, thanks for the shortcuts book too! > > Iain > > > > > > > > _______________________________________________ > > twill mailing list > > [email protected] > > http://lists.idyll.org/listinfo/twill > > _______________________________________________ twill mailing list [email protected] http://lists.idyll.org/listinfo/twill
