Michael...

On Thu, May 10, 2007 at 09:59:09AM -0000, Michael G. Noll wrote:
> first of all, thanks for your work on an alternative paginator. I'm
> currently testing it, and I am pleased so far :-)

Thank you for the feedback. I already thought I'm the only who uses that
module. :)

> Bug
> =======
> 
> The relevant code is in Page.__init__().
> 
> $ diff paginate_original.py paginate.py
> 128c128
> <             self.page_count = int(ceil(self.item_count /
> self.items_per_page))
> ---
> >             self.page_count = int(ceil(1.0 * self.item_count / 
> > self.items_per_page))
> 
> In the original paginate.py, integer division is used. For example, if
> item_count is 8 and items_per_page is 5, than "item_count /
> items_per_page" gives 1 as an int where it should give 1.6 as a float
> and thus 2 after ceil(). The best workaround to force true division is
> to multiply with "1.0" first [1].

Right. I forgot about integer division again. I took Matt's proposal and
changed the source. Thanks for the pointer.

> Documentation
> =========
> For Page.navigator(), the doc string says:
> 
> "Either link_format or link_var must be set!"
> 
> First, the link_format parameter does not exist (I guess: not
> anymore).

Correct. Before I used the abilities of the Routes mapping I had a
format string that was used to generate links. But Routes is more
versatile here. I removed that line from the docstring. Oh, well, the
API has changed a dozen times already before I dared publishing my code.

> Second, link_var has a very beautiful default value, so
> nothing must be set in advance. :-)

Right. I love good defaults, too. Saves typing later.

> On a side node, the paginator.rest file is more up to date when it
> talks about adding $ {c.paginator.navigator()} (without parameters)
> for integrating navigation into the example.

I revised the rest documentation. But I believe people will need the
rest file in addition to the docstrings for examples.

The new version is online at http://workaround.org/pylons

Cheers
 Christoph


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to