Re: [viewvc-dev] Re: [viewvc-users] Don't display binary files

"C. Michael Pilato" <[email protected]> Thu, 20 Nov 2008 11:28:53 -0500
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Organization CollabNet, Inc.
Message-ID <49259045.9090004__1702.20017103038$1227198628$gmane$org@collab.net>
JJ wrote:
>     I like this, but I wouldn't add a new config file.  I'd just add a new
>     configuration option that follows the format of our existing multi-value
>     options.  And I'd let the values take wildcards (text/*,
>     application/*-xml,
>     etc.), too, so you wouldn't have to specify every single little thing.
>  
> Patch attached.  I also need to clean up the default templates
> to respect prefer_markup values.

Nice patch, JJ.  It needs a couple of tweaks, though:

   - the viewvc.conf.dist file should, if presenting an uncommented option,
     present the same option value that is used as the default in
     lib/config.py.  In this case, I think you got lib/config.py right
     (in that we only want to assume that text/* is text by default),
     but the viewvc.conf.dist file is wrong.  Just make the value in
     that file "text/*", and maybe add a second, commented-out example
     that shows some of the other types folks might want in there.

   - I don't like the "convert to a valid regexp" logic.  If we're going
     to use regexps, let's expose that directly to users.  If we really
     only care about '*' as a wildcard, then maybe the 'fnmatch' module
     is what you want to use for comparisons (since mime types are
     slash-delimited like paths are).

-- 
C. Michael Pilato <[email protected]>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFJJZBFokEGqRcG/W4RAtPvAJ9VKsJafN8FakF5J4fezgoPuOzwwQCgtE16
NstRP2zQkst0CRj67dIvB7c=
=ft5Z
-----END PGP SIGNATURE-----