← Back to team overview

launchpad-dev team mailing list archive

Re: Today's project page review

 

On Sep 3, 2009, at 9:55 AM, Curtis Hovey wrote:

This is nice. I was thinking of doing this as a tales formatter like
shorten:
   release/file/name/fmt:ellipse/32

I will steal liberally from you example. I was planning to use kiko's
thoughts.

       kiko: middle = len(str)/2
       kiko: return s[:middle - 2] + "[...]" + s[middle+2]
       kiko: or something like that
kiko: taking care of the corner cases (len(s) < middle * 2, etc)

If I can reuse that for the <title> reverse breadcrumb shortener, that would be awesome.

The rule Martin and I came up with is this: <title> will be the reversed breadcrumbs, with each component separated by a colon, and truncated to say 20 characters.

-Barry

Attachment: PGP.sig
Description: This is a digitally signed message part


Follow ups

References