Edgewall Software

Opened 19 years ago

Last modified 18 years ago

#2105 closed enhancement

identify the mimetype — at Version 2

Reported by: Otavio Salvador Owned by: Christian Boos
Priority: high Milestone: 0.10
Component: general Version: devel
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

Would be great if trac identify the mime type also by reading the file header.

For example, debian/rules files has it's first line set to #!/usr/bin/make -f and is safe to use Makefile highlight for it. This apply too to shell scripts and others.

Thanks in advance,

Change History (3)

comment:1 by Christian Boos, 19 years ago

Milestone: 0.9
Owner: changed from Jonas Borgström to Christian Boos
Severity: normalminor
Version: 0.8.4devel

Additional requirement: support Emacs mode specification, e.g.

# This is a -*- Makefile -*- 

foo: bar
       cp bar foo

by Christian Boos, 19 years ago

Attachment: mimeview-refactoring.patch added

Implementation of the feature, which required a bit of refactoring (mainly, get the content first, before it can be passed on to Mimeview.get_mimetype())

comment:2 by Christian Boos, 19 years ago

Description: modified (diff)
Milestone: 1.0
Status: newassigned

The above refactoring is a kind of follow-up to r2276: less duplicated mimeview related code in attachment.py, browser.py and now changeset.py, and put the common code in mimeview/api.py.

Not necessarily for 0.9, as it's just an enhancement.

Note: See TracTickets for help on using tickets.