launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #00748
Re: Today's project page review
On Thu, 3 Sep 2009 11:01:35 -0300
Christian Robottom Reis <kiko@xxxxxxxxxxxxx> wrote:
...
> 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.
Good point.
I guess there are two approaches to take. One is the approach I took,
which is to have a list of interesting things to look for, and the
other is the more general approach Curtis outlined.
For release files, I think the first approach - with the addition of
some code to also preserve interesting version information - would give
slightly better results.
For breadcrumbs, Curtis' approach would work best, and the first
approach would hardly do anything useful at all.
>
> - I'd love to see a test that ensures this works for filenames with
> multiple extensions (i.e. tar.gz)
Doh, I meant to add that. It does handle that correctly though, for the
compound extensions that mimetypes knows about anyway.
>
> - 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!
Thanks Curtis :)
References