← Back to team overview

launchpad-dev team mailing list archive

Re: Today's project page review

 

On Thu, Sep 03, 2009 at 02:47:45PM +0100, Gavin Panella wrote:
> On Wed, 2 Sep 2009 17:15:04 -0300
> Christian Robottom Reis <kiko@xxxxxxxxxxxxx> wrote:
> 
> > On Wed, Sep 02, 2009 at 08:03:29PM +0100, Julian Edwards wrote:
> > > On Wednesday 02 September 2009 17:14:51 Curtis Hovey wrote:
> > > > >         * The font for the files is too big, which leads to them being
> > > > >           super-truncated. I think the middle of the filename could be
> > > > >           truncated when too long (Little_[...]_3.0.tgz).
> > > > 
> > > > I saw Julian working on this. I want to make this happen for all uses of
> > > > this portlet. yes, the font is too big.
> > > 
> > > Actually I cheated, it was a hard-coded string in a mock-up.  We've now 
> > > ditched that mock-up in favour of something else, so I'm not working on it.  
> > 
> > Well, it's pretty easy to build a formatter which truncates this way; I
> > could even help somebody do it if there's an interested hacker that is
> > game.
> 
> Erm, I got tempted, for fun.
> 
> http://pastebin.ubuntu.com/264420/

Wow, nice job! Some comments:

    - I'm not sure the approach of trucating at the max length actually
      preserves the version in many filenames. For instance:

        foo-bar-baz-bazoo_22.443.tar.gz
        the-macos-installers-often-have-long-names-2.44.dmg
        you-know-anonymous-aheads-for-gold-4.11~ubuntu1.deb

      You may have to return a 4-tuple to accomodate this.

    - I'd love to see a test that ensures this works for filenames with
      multiple extensions (i.e. tar.gz)

    - I think a standard, default length for truncation should probably
      be provided; it would at least suggest consistency.

    - I think the default ellipsis should be [...] or else it will look
      a bit weird

    - I think the extension should probably be returned without the dot,
      but I'm not sure. What would you expect as a caller?

Thanks for trying this out. Curtis, I suspect you'll have some code to
integrate soonish!
-- 
Christian Robottom Reis | [+55 16] 3376 0125 | http://launchpad.net/~kiko
                        | [+55 16] 9112 6430 | http://async.com.br/~kiko



Follow ups

References