Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Mimeview and troff
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tim Hatch  
View profile  
(1 user)  More options Dec 12 2006, 12:06 am
From: "Tim Hatch" <trac-...@timhatch.com>
Date: Mon, 11 Dec 2006 21:06:02 -0800
Local: Tues, Dec 12 2006 12:06 am
Subject: Mimeview and troff
I'm still a bit shaky on exactly what to call these files, but I've
gathered the roff, troff, groff, and nroff all pretty much refer to the
same format (listed as application/x-troff in Trac).  These include
manpage source, of which one file exists in the Trac source tree.

Its extension is not matched by the current trac/mimeview/api.py
(either of the two identical lines, hrmm), but extensions are specified
in the Pygments lexer for it (since
http://trac.pocoo.org/changeset/2424).  Do you think it is feasible for
the renderer's lexers' extensions (which are admittedly in fnmatch
style) from Pygments to be overlaid to KNOWN_MIME_TYPES (or otherwise
made available to get_mimetype) at runtime?

I've patched get_mimetype to do this[1], but I'm slightly wary of
putting code to call Pygments in the core, even wrapped with a
try/catch block[2].  Opinions?

Tim

[1]: the fun part is...
from pygments import get_lexer_for_filename
mimetype = get_lexer_for_filename(filename).mimetypes[0]

[2]: if it finds the mimetype is not already in the mapping, it
probably needs to make sure something will be findable to render it
too, making this kind of messy for new mimetypes.  Luckily this
particular one already exists.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christian Boos  
View profile  
 More options Dec 13 2006, 2:40 am
From: Christian Boos <cb...@neuf.fr>
Date: Wed, 13 Dec 2006 08:40:45 +0100
Local: Wed, Dec 13 2006 2:40 am
Subject: Re: [Trac-dev] Mimeview and troff

Tim Hatch wrote:
> ...

> I've patched get_mimetype to do this[1], but I'm slightly wary of
> putting code to call Pygments in the core, even wrapped with a
> try/catch block[2].  Opinions?

We need a IMimeTypeDetector interface/extension point for this.
... and we'd need the #3332 changes before that, I think, as there I've
refactored the mime detection code and put place holders for
IMimeTypeDetector and ICharsetDetector extension points, without
actually implementing those as I didn't want to overload the patch which
was already quite big...

I think it would be worth creating a branch for that, where we could
finish the work together.
Would you be interested?

Are the other committers OK for Tim getting a commit access?

-- Christian


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Emmanuel Blot  
View profile  
 More options Dec 13 2006, 5:28 am
From: "Emmanuel Blot" <manu.b...@gmail.com>
Date: Wed, 13 Dec 2006 11:28:21 +0100
Local: Wed, Dec 13 2006 5:28 am
Subject: Re: [Trac-dev] Re: Mimeview and troff
> Are the other committers OK for Tim getting a commit access?

+1

--
Manu


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Hatch  
View profile  
 More options Dec 13 2006, 11:58 am
From: "Tim Hatch" <trac-...@timhatch.com>
Date: Wed, 13 Dec 2006 08:58:38 -0800
Local: Wed, Dec 13 2006 11:58 am
Subject: Re: Mimeview and troff

> I think it would be worth creating a branch for that, where we could
> finish the work together.
> Would you be interested?

Yes, certainly.

Tim


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonas Borgström  
View profile  
 More options Dec 14 2006, 1:21 pm
From: Jonas Borgström <jo...@edgewall.com>
Date: Thu, 14 Dec 2006 19:21:50 +0100
Local: Thurs, Dec 14 2006 1:21 pm
Subject: Re: [Trac-dev] Re: Mimeview and troff

Christian Boos wrote:

> Are the other committers OK for Tim getting a commit access?

+1. I'll set it up.

Cheers,
Jonas


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google