Re: Pyblosxom permalinks are not permanent
Steve Hoelzer <[email protected]> Thu, 10 Sep 2009 10:07:42 -0500
| Newsgroups | gmane.comp.web.pyblosxom.user |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Sep 10, 2009 at 9:03 AM, Steve Hoelzer <[email protected]> wrote: > On Wed, Sep 9, 2009 at 4:23 PM, will <[email protected]> wrote: >> Steve Hoelzer wrote: >>> It also seems wasteful to render some pages twice (ex: >>> /2009/index.html). It would be nice to detect the duplicates and get >>> rid of them. >> >> If you can implement this, feel free to do so and send in a patch. > > I'm not sure if you care about the order that pages are rendered. If > not, here's a simple solution. At the end of the "walk" function, > instead of this: > > return _walk_internal(root, recurse, pattern, ignorere, return_folders) > > Use sorted(set(...)) like this: > > return sorted(set(_walk_internal(root, recurse, pattern, ignorere, > return_folders))) Umm, nope. This is wrong. That only applies to the categories and doesn't check if date archives result in an identical path. The real fix is to use sorted(set(...)) on 'renderme' near the end of runstaticrenderer(). The middle lines are new: print "building %s files." % len(renderme) # date archives and categories may give identical paths, so remove duplicates renderme = sorted(set(renderme)) for url, q in renderme: Steve ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july