changeset 1604:b2322cdabd8a

Added support for parser import with third-party legacy names.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Tue, 03 Oct 2006 15:32:55 +0200
parents 767109c48208
children c4f2db04084b 0101edf9d308
files MoinMoin/wikiutil.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/wikiutil.py	Tue Oct 03 00:17:04 2006 +0200
+++ b/MoinMoin/wikiutil.py	Tue Oct 03 15:32:55 2006 +0200
@@ -885,6 +885,7 @@
         self.major = self.minor = None # sanitized mime type and subtype
         self.params = {} # parameters like "charset" or others
         self.charset = None # this stays None until we know for sure!
+        self.raw_mimestr = mimestr
 
         if mimestr:
             self.parse_mimetype(mimestr)
@@ -988,8 +989,10 @@
         mimetype = self.mime_type()
         modname = mimetype.replace("/", "_").replace("-", "_").replace(".", "_")
         fragments = modname.split('_')
-        for length in range(len(fragments), 0, -1):
+        for length in range(len(fragments), 1, -1):
             yield "_".join(fragments[:length])
+        yield self.raw_mimestr
+        yield fragments[0]
         yield "application_octet_stream"