Christian Boos <christian.b...@free.fr> writes:

> Note that mimetypes.guess_type() is also called as part of
> Mimeview.get_mimetype() [1] and that one is called when the
> Node.content_type returns None.

Thank you Christian, I really missed that part of the machinery. In
particular, I was tricked by the default value for the option
"mimeviewer.mime_map_patterns":

  text/plain:README|INSTALL|COPYING.*

that obviously prevented "README.rst" to get considered as
reStructuredText. As soon as I prepended "text/x-rst:.*\.rst$" to that
setting, everything seems working the way I like :-)

One minor point is that the fallback is triggered when Node.content_type
returns either None or '', so apparently the VC backend cannot prevent
the heuristic to happen for example on a directory with an unusual
"INSTALLABLE.STUFF" name...

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  |                 -- Fortunato Depero, 1929.

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-dev+unsubscr...@googlegroups.com.
To post to this group, send email to trac-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/trac-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to