Hi,

I took a quick look into the mime module since a few years and came up with
the attached version, added the method "get_type_by_data()", which you might
test. I also noticed that it implements the quite outdatet version 0.13 of
the specification, where 0.18 is the newest. I have no time to update this,
but if you are interested in helping out with that you are welcome.

regards, heinrich

On 10/14/08, Tony Houghton <[EMAIL PROTECTED]> wrote:
>
> Package: python-xdg
> Version: 0.15-1.1
> Severity: wishlist
>
>
> It would be useful if the Mime module had a function similar to
> get_type_by_contents() but which works on text/data already loaded into
> memory instead of loading the data, given a pathname.
>
> I'm writing a text editor and currently I'll either have to reimplement
> large chunks of Mime.py or have it load an extra copy (or at least
> however much of it the implementation requires) of a file already in
> memory.
>
> -- System Information:
> Debian Release: lenny/sid
>   APT prefers unstable
>   APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 2.6.27 (SMP w/2 CPU cores)
> Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/bash
>
> Versions of packages python-xdg depends on:
> ii  python                        2.5.2-2    An interactive high-level
> object-o
> ii  python-support                0.8.6      automated rebuilding support
> for P
>
> python-xdg recommends no packages.
>
> python-xdg suggests no packages.
>
> -- no debconf information
>
>
>
>

Attachment: Mime.py
Description: Binary data

Reply via email to