[Patches] [ python-Patches-554192 ] mimetypes: all extensions for a type

noreply@sourceforge.net noreply@sourceforge.net
Tue, 30 Jul 2002 05:34:05 -0700


Patches item #554192, was opened at 2002-05-09 19:31
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=554192&group_id=5470

Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Walter Dörwald (doerwalter)
Assigned to: Nobody/Anonymous (nobody)
Summary: mimetypes: all extensions for a type

Initial Comment:
This patch adds a function guess_all_extensions to 
mimetypes.py. This function returns all known 
extensions for a given type, not just the first one 
found in the types_map dictionary. guess_extension is 
still present and returns the first from the list.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-07-30 14:34

Message:
Logged In: YES 
user_id=21627

I'm in favour of exposing it on the module level. If you are
uncertain, you might want to ask on python-dev.

----------------------------------------------------------------------

Comment By: Walter Dörwald (doerwalter)
Date: 2002-07-30 13:00

Message:
Logged In: YES 
user_id=89016

It *is* used in two spots: The constructor and the readfp 
method. But exposing it at the module level could make 
sense, because it is the atomic method of adding mime type 
information. So should it change the patch to expose it at the 
module level and change the LaTeX documentation 
accordingly?

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-07-29 10:44

Message:
Logged In: YES 
user_id=21627

I can't see the point of making it private, since it is not
used inside the module. If you plan to use it, that usage
certainly is outside of the module, so the method would be
public.

If it is public, it needs to be exposed on the module level,
and it needs to be documented.

----------------------------------------------------------------------

Comment By: Walter Dörwald (doerwalter)
Date: 2002-07-29 10:23

Message:
Logged In: YES 
user_id=89016

The patch adds an inverted mapping (i.e. mapping from type
to a list of extensions). add_type simplifies adding a
type<->ext mapping to both dictionaries. If this method
should not be exposed we could make the name private.
(_add_type)

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-07-28 12:30

Message:
Logged In: YES 
user_id=21627

What is the role of add_type in this patch?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=554192&group_id=5470