changeset 3339:a07ac5a0811e

moved definition of text mimetype for parsers into config
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 19 Mar 2008 18:31:01 +0100
parents 5f660b3c1cd7
children afef9c8b2ed2
files MoinMoin/config/__init__.py MoinMoin/wikiutil.py
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/__init__.py	Wed Mar 19 18:14:38 2008 +0100
+++ b/MoinMoin/config/__init__.py	Wed Mar 19 18:31:01 2008 +0100
@@ -14,6 +14,11 @@
 # List of image types browser do support regulary
 browser_supported_images = ('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico', )
 
+# Parser to use mimetype text
+parser_text_mimetype = ('plain', 'csv', 'rst', 'docbook', 'latex', 'tex', 'html', 'css',
+                       'xml', 'python', 'perl', 'php', 'ruby', 'javascript',
+                       'cplusplus', 'java', 'pascal', 'diff', 'gettext', 'xslt', 'creole', )
+
 # When creating files, we use e.g. 0666 & config.umask for the mode:
 umask = 0770
 
--- a/MoinMoin/wikiutil.py	Wed Mar 19 18:14:38 2008 +0100
+++ b/MoinMoin/wikiutil.py	Wed Mar 19 18:31:01 2008 +0100
@@ -998,9 +998,7 @@
             type "wiki" instead of "text/moin-wiki".
         """
         format = format.lower()
-        if format in ('plain', 'csv', 'rst', 'docbook', 'latex', 'tex', 'html', 'css',
-                      'xml', 'python', 'perl', 'php', 'ruby', 'javascript',
-                      'cplusplus', 'java', 'pascal', 'diff', 'gettext', 'xslt', 'creole', ):
+        if format in config.parser_text_mimetype:
             mimetype = 'text', format
         else:
             mapping = {