changeset 216:661a57c747bd

replace mimetype by contenttype, use more constants to deal correctly with text items, we do not just need the simple mimetype like "text/plain", but rather the contenttype like "text/plain;charset=utf-8" or, for content from moin 1.9, "text/x.moin.wiki;format=1.9;charset=utf-8" to make moin use the moinwiki19_in converter. this changeset mostly deals with the stupid task of renaming the constant, the attributes, the arguments, qs arg names, etc. - so that everything that does not mean a basic mimetype major/minor should be named contenttype now. it also fixes a few places that used strings and not the constants from MoinMoin.config or where imports were missing. further changes will be needed to really deal with the charset and other params. also, the value of MoinMoin.config.CONTENTTYPE will need to get changed later.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 07 May 2011 20:22:30 +0200
parents 1c835a7297ea
children 60242b1ba235
files MoinMoin/_tests/__init__.py MoinMoin/_tests/test_test_environ.py MoinMoin/apps/feed/views.py MoinMoin/apps/frontend/views.py MoinMoin/config/__init__.py MoinMoin/items/__init__.py MoinMoin/items/_tests/test_Item.py MoinMoin/script/maint/create_item.py MoinMoin/storage/_tests/test_backends_fs19.py MoinMoin/storage/_tests/test_terms.py MoinMoin/storage/backends/_flatutils.py MoinMoin/storage/backends/fileserver.py MoinMoin/storage/backends/flatfile.py MoinMoin/storage/backends/fs19.py MoinMoin/storage/backends/indexing.py MoinMoin/templates/global_history.html MoinMoin/templates/global_index.html MoinMoin/templates/history.html MoinMoin/templates/index.html MoinMoin/templates/modify_anywikidraw.html MoinMoin/templates/modify_show_template_selection.html MoinMoin/templates/modify_show_type_selection.html MoinMoin/templates/modify_twikidraw.html MoinMoin/themes/__init__.py MoinMoin/translations/MoinMoin.pot MoinMoin/translations/de/LC_MESSAGES/messages.po
diffstat 26 files changed, 162 insertions(+), 159 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/__init__.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/_tests/__init__.py	Sat May 07 20:22:30 2011 +0200
@@ -14,6 +14,7 @@
 from flask import g as flaskg
 
 from MoinMoin import config, security, user
+from MoinMoin.config import NAME, CONTENTTYPE
 from MoinMoin.items import Item
 from MoinMoin.util.crypto import random_string
 from MoinMoin.storage.error import ItemAlreadyExistsError
@@ -54,10 +55,10 @@
     rev = item.create_revision(revno)
     for key, value in meta.items():
         rev[key] = value
-    if not 'name' in rev:
-        rev['name'] = name
-    if not 'mimetype' in rev:
-        rev['mimetype'] = u'application/octet-stream'
+    if not NAME in rev:
+        rev[NAME] = name
+    if not CONTENTTYPE in rev:
+        rev[CONTENTTYPE] = u'application/octet-stream'
     rev.write(data)
     item.commit()
     return item
--- a/MoinMoin/_tests/test_test_environ.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/_tests/test_test_environ.py	Sat May 07 20:22:30 2011 +0200
@@ -11,7 +11,7 @@
 from flask import current_app as app
 from flask import g as flaskg
 
-from MoinMoin.config import IS_SYSITEM, SYSITEM_VERSION
+from MoinMoin.config import NAME, CONTENTTYPE, IS_SYSITEM, SYSITEM_VERSION
 from MoinMoin.storage.error import NoSuchItemError
 
 from MoinMoin._tests import wikiconfig
@@ -35,8 +35,8 @@
         assert py.test.raises(NoSuchItemError, storage.get_item, itemname)
         item = storage.create_item(itemname)
         new_rev = item.create_revision(0)
-        new_rev['name'] = itemname
-        new_rev['mimetype'] = u'text/plain'
+        new_rev[NAME] = itemname
+        new_rev[CONTENTTYPE] = u'text/plain'
         item.commit()
         assert storage.has_item(itemname)
         assert not storage.has_item("FrontPage")
@@ -68,16 +68,16 @@
             assert rev[SYSITEM_VERSION] == 1
             # check whether this dirties the backend for the second iteration of the test
             new_rev = item.create_revision(1)
-            new_rev['name'] = pagename
-            new_rev['mimetype'] = u'text/plain'
+            new_rev[NAME] = pagename
+            new_rev[CONTENTTYPE] = u'text/plain'
             item.commit()
 
         itemname = u"OnlyForThisTest"
         assert not storage.has_item(itemname)
         new_item = storage.create_item(itemname)
         new_rev = new_item.create_revision(0)
-        new_rev['name'] = itemname
-        new_rev['mimetype'] = u'text/plain'
+        new_rev[NAME] = itemname
+        new_rev[CONTENTTYPE] = u'text/plain'
         new_item.commit()
         assert storage.has_item(itemname)
 
--- a/MoinMoin/apps/feed/views.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/apps/feed/views.py	Sat May 07 20:22:30 2011 +0200
@@ -23,7 +23,7 @@
 from MoinMoin import wikiutil
 from MoinMoin.i18n import _, L_, N_
 from MoinMoin.apps.feed import feed
-from MoinMoin.config import NAME, ACL, MIMETYPE, ACTION, ADDRESS, HOSTNAME, USERID, COMMENT
+from MoinMoin.config import NAME, ACL, ACTION, ADDRESS, HOSTNAME, USERID, COMMENT
 from MoinMoin.themes import get_editor_info
 from MoinMoin.items import Item
 from MoinMoin.util.crypto import cache_key
--- a/MoinMoin/apps/frontend/views.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/apps/frontend/views.py	Sat May 07 20:22:30 2011 +0200
@@ -39,7 +39,7 @@
 from MoinMoin.items import Item, NonExistent
 from MoinMoin.items import ROWS_META, COLS, ROWS_DATA
 from MoinMoin import config, user, wikiutil
-from MoinMoin.config import MIMETYPE, ITEMLINKS, ITEMTRANSCLUSIONS
+from MoinMoin.config import CONTENTTYPE, ITEMLINKS, ITEMTRANSCLUSIONS
 from MoinMoin.util.forms import make_generator
 from MoinMoin.util import crypto
 from MoinMoin.security.textcha import TextCha, TextChaizedForm, TextChaValid
@@ -134,7 +134,7 @@
     content = render_template('show.html',
                               item=item, item_name=item.name,
                               rev=item.rev,
-                              mimetype=item.mimetype,
+                              contenttype=item.contenttype,
                               first_rev_no=first_rev,
                               last_rev_no=last_rev,
                               data_rendered=Markup(item._render_data()),
@@ -199,7 +199,7 @@
     return render_template('meta.html',
                            item=item, item_name=item.name,
                            rev=item.rev,
-                           mimetype=item.mimetype,
+                           contenttype=item.contenttype,
                            first_rev_no=first_rev,
                            last_rev_no=last_rev,
                            meta_rendered=Markup(item._render_meta()),
@@ -228,7 +228,7 @@
     To get the converted item, we just feed his converter,
     with the internal representation of the item.
     """
-    mimetype = request.values.get('mimetype')
+    contenttype = request.values.get('contenttype')
     try:
         item = Item.create(item_name, rev_no=-1)
     except AccessDeniedError:
@@ -238,7 +238,7 @@
     # XXX Maybe use a random name to be sure it does not exist
     item_name_converted = item_name + 'converted'
     try:
-        converted_item = Item.create(item_name_converted, mimetype=mimetype)
+        converted_item = Item.create(item_name_converted, contenttype=contenttype)
     except AccessDeniedError:
         abort(403)
     return converted_item._convert(item.internal_representation())
@@ -251,10 +251,10 @@
     On POST, saves the new page (unless there's an error in input, or cancelled).
     After successful POST, redirects to the page.
     """
-    mimetype = request.values.get('mimetype')
+    contenttype = request.values.get('contenttype')
     template_name = request.values.get('template')
     try:
-        item = Item.create(item_name, mimetype=mimetype)
+        item = Item.create(item_name, contenttype=contenttype)
     except AccessDeniedError:
         abort(403)
     if request.method == 'GET':
@@ -287,7 +287,7 @@
                 item.modify()
                 item_modified.send(app._get_current_object(),
                                    item_name=item_name)
-                if mimetype in ('application/x-twikidraw', 'application/x-anywikidraw', 'application/x-svgdraw'):
+                if contenttype in ('application/x-twikidraw', 'application/x-anywikidraw', 'application/x-svgdraw'):
                     # TWikiDraw/AnyWikiDraw/SvgDraw POST more than once, redirecting would break them
                     return "OK"
             except AccessDeniedError:
@@ -1346,15 +1346,15 @@
     return oldrevno, newrevno
 
 
-def _common_mimetype(rev1, rev2):
-    mt1 = rev1.get(MIMETYPE)
-    mt2 = rev2.get(MIMETYPE)
-    if mt1 == mt2:
-        # easy, exactly the same mimetype, call do_diff for it
-        commonmt = mt1
+def _common_type(rev1, rev2):
+    ct1 = rev1.get(CONTENTTYPE)
+    ct2 = rev2.get(CONTENTTYPE)
+    if ct1 == ct2:
+        # easy, exactly the same content type, call do_diff for it
+        commonmt = ct1
     else:
-        major1 = mt1.split('/')[0]
-        major2 = mt2.split('/')[0]
+        major1 = ct1.split('/')[0]
+        major2 = ct2.split('/')[0]
         if major1 == major2:
             # at least same major mimetype, use common base item class
             commonmt = major1 + '/'
@@ -1369,10 +1369,10 @@
     oldrev = item.get_revision(oldrevno)
     newrev = item.get_revision(newrevno)
 
-    commonmt = _common_mimetype(oldrev, newrev)
+    commonmt = _common_type(oldrev, newrev)
 
     try:
-        item = Item.create(item.name, mimetype=commonmt, rev_no=newrevno)
+        item = Item.create(item.name, contenttype=commonmt, rev_no=newrevno)
     except AccessDeniedError:
         abort(403)
     rev_nos = item.rev.item.list_revisions()
@@ -1391,10 +1391,10 @@
     oldrev = item.get_revision(oldrevno)
     newrev = item.get_revision(newrevno)
 
-    commonmt = _common_mimetype(oldrev, newrev)
+    commonmt = _common_type(oldrev, newrev)
 
     try:
-        item = Item.create(item.name, mimetype=commonmt, rev_no=newrevno)
+        item = Item.create(item.name, contenttype=commonmt, rev_no=newrevno)
     except AccessDeniedError:
         abort(403)
     return item._render_data_diff_raw(oldrev, newrev)
--- a/MoinMoin/config/__init__.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/config/__init__.py	Sat May 07 20:22:30 2011 +0200
@@ -96,7 +96,7 @@
 # needs more precise name / use case:
 SOMEDICT = "somedict"
 
-MIMETYPE = "mimetype"
+CONTENTTYPE = "mimetype" # XXX change later to "content-type"
 SIZE = "size"
 LANGUAGE = "language"
 ITEMLINKS = "itemlinks"
--- a/MoinMoin/items/__init__.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/items/__init__.py	Sat May 07 20:22:30 2011 +0200
@@ -60,7 +60,7 @@
                                    StorageError
 from MoinMoin.config import UUID, NAME, NAME_OLD, MTIME, REVERTED_TO, ACL, \
                             IS_SYSITEM, SYSITEM_VERSION,  USERGROUP, SOMEDICT, \
-                            MIMETYPE, SIZE, LANGUAGE, ITEMLINKS, ITEMTRANSCLUSIONS, \
+                            CONTENTTYPE, SIZE, LANGUAGE, ITEMLINKS, ITEMTRANSCLUSIONS, \
                             TAGS, ACTION, ADDRESS, HOSTNAME, USERID, EXTRA, COMMENT, \
                             HASH_ALGORITHM
 
@@ -80,8 +80,8 @@
 
 class DummyRev(dict):
     """ if we have no stored Revision, we use this dummy """
-    def __init__(self, item, mimetype):
-        self[MIMETYPE] = mimetype
+    def __init__(self, item, contenttype):
+        self[CONTENTTYPE] = contenttype
         self.item = item
         self.timestamp = 0
         self.revno = None
@@ -104,11 +104,11 @@
 class Item(object):
     """ Highlevel (not storage) Item """
     @classmethod
-    def create(cls, name=u'', mimetype=None, rev_no=None, item=None):
+    def create(cls, name=u'', contenttype=None, rev_no=None, item=None):
         if rev_no is None:
             rev_no = -1
-        if mimetype is None:
-            mimetype = 'application/x-nonexistent'
+        if contenttype is None:
+            contenttype = 'application/x-nonexistent'
 
         try:
             if item is None:
@@ -118,8 +118,8 @@
         except NoSuchItemError:
             logging.debug("No such item: %r" % name)
             item = DummyItem(name)
-            rev = DummyRev(item, mimetype)
-            logging.debug("Item %r, created dummy revision with mimetype %r" % (name, mimetype))
+            rev = DummyRev(item, contenttype)
+            logging.debug("Item %r, created dummy revision with contenttype %r" % (name, contenttype))
         else:
             logging.debug("Got item: %r" % name)
             try:
@@ -130,37 +130,37 @@
                     # XXX add some message about invalid revision
                 except NoSuchRevisionError:
                     logging.debug("Item %r has no revisions." % name)
-                    rev = DummyRev(item, mimetype)
-                    logging.debug("Item %r, created dummy revision with mimetype %r" % (name, mimetype))
+                    rev = DummyRev(item, contenttype)
+                    logging.debug("Item %r, created dummy revision with contenttype %r" % (name, contenttype))
             logging.debug("Got item %r, revision: %r" % (name, rev_no))
-        mimetype = rev.get(MIMETYPE) or mimetype # XXX: Why do we need ... or ... ?
-        logging.debug("Item %r, got mimetype %r from revision meta" % (name, mimetype))
+        contenttype = rev.get(CONTENTTYPE) or contenttype # XXX: Why do we need ... or ... ?
+        logging.debug("Item %r, got contenttype %r from revision meta" % (name, contenttype))
         logging.debug("Item %r, rev meta dict: %r" % (name, dict(rev)))
 
-        def _find_item_class(mimetype, BaseClass, best_match_len=-1):
-            #logging.debug("_find_item_class(%r,%r,%r)" % (mimetype, BaseClass, best_match_len))
+        def _find_item_class(contenttype, BaseClass, best_match_len=-1):
+            #logging.debug("_find_item_class(%r,%r,%r)" % (contenttype, BaseClass, best_match_len))
             Class = None
             for ItemClass in BaseClass.__subclasses__():
                 for supported_mimetype in ItemClass.supported_mimetypes:
-                    if mimetype.startswith(supported_mimetype):
+                    if contenttype.startswith(supported_mimetype):
                         match_len = len(supported_mimetype)
                         if match_len > best_match_len:
                             best_match_len = match_len
                             Class = ItemClass
                             #logging.debug("_find_item_class: new best match: %r by %r)" % (supported_mimetype, ItemClass))
-                best_match_len, better_Class = _find_item_class(mimetype, ItemClass, best_match_len)
+                best_match_len, better_Class = _find_item_class(contenttype, ItemClass, best_match_len)
                 if better_Class:
                     Class = better_Class
             return best_match_len, Class
 
-        ItemClass = _find_item_class(mimetype, cls)[1]
-        logging.debug("ItemClass %r handles %r" % (ItemClass, mimetype))
-        return ItemClass(name=name, rev=rev, mimetype=mimetype)
+        ItemClass = _find_item_class(contenttype, cls)[1]
+        logging.debug("ItemClass %r handles %r" % (ItemClass, contenttype))
+        return ItemClass(name=name, rev=rev, contenttype=contenttype)
 
-    def __init__(self, name, rev=None, mimetype=None):
+    def __init__(self, name, rev=None, contenttype=None):
         self.name = name
         self.rev = rev
-        self.mimetype = mimetype
+        self.contenttype = contenttype
 
     def get_meta(self):
         return self.rev or {}
@@ -193,9 +193,9 @@
             # FROM_mimetype --> DOM
             # if so we perform the transformation, otherwise we don't
             from MoinMoin.converter import default_registry as reg
-            input_conv = reg.get(Type(self.mimetype), type_moin_document)
+            input_conv = reg.get(Type(self.contenttype), type_moin_document)
             if not input_conv:
-                raise TypeError("We cannot handle the conversion from %s to the DOM tree" % self.mimetype)
+                raise TypeError("We cannot handle the conversion from %s to the DOM tree" % self.contenttype)
             smiley_conv = reg.get(type_moin_document, type_moin_document,
                     icon='smiley')
 
@@ -261,11 +261,11 @@
     def _do_modify_show_templates(self):
         # call this if the item is still empty
         rev_nos = []
-        item_templates = self.get_templates(self.mimetype)
+        item_templates = self.get_templates(self.contenttype)
         return render_template('modify_show_template_selection.html',
                                item_name=self.name,
                                rev=self.rev,
-                               mimetype=self.mimetype,
+                               contenttype=self.contenttype,
                                templates=item_templates,
                                first_rev_no=rev_nos and rev_nos[0],
                                last_rev_no=rev_nos and rev_nos[-1],
@@ -371,30 +371,30 @@
     def modify(self):
         # called from modify UI/POST
         data_file = request.files.get('data_file')
-        mimetype = request.values.get('mimetype', 'text/plain')
+        contenttype = request.values.get('contenttype', 'text/plain') # XXX
         if data_file and data_file.filename:
             # user selected a file to upload
             data = data_file.stream
-            mimetype = MimeType(filename=data_file.filename).mime_type()
+            contenttype = MimeType(filename=data_file.filename).mime_type()
         else:
             # take text from textarea
             data = request.form.get('data_text', '')
             if data:
                 data = self.data_form_to_internal(data)
                 data = self.data_internal_to_storage(data)
-                mimetype = 'text/plain'
+                contenttype = 'text/plain'
             else:
                 data = '' # could've been u'' also!
-                mimetype = None
+                contenttype = None
         meta_text = request.form.get('meta_text', '')
         try:
             meta = self.meta_text_to_dict(meta_text)
         except ValueError:
             meta = {} # XXX maybe rather validate and reject invalid json
         comment = request.form.get('comment')
-        return self._save(meta, data, mimetype=mimetype, comment=comment)
+        return self._save(meta, data, contenttype=contenttype, comment=comment)
 
-    def _save(self, meta, data, name=None, action=u'SAVE', mimetype=None, comment=u''):
+    def _save(self, meta, data, name=None, action=u'SAVE', contenttype=None, comment=u''):
         if name is None:
             name = self.name
         backend = flaskg.storage
@@ -405,9 +405,9 @@
         try:
             currentrev = storage_item.get_revision(-1)
             rev_no = currentrev.revno
-            if mimetype is None:
-                # if we didn't get mimetype info, thus reusing the one from current rev:
-                mimetype = currentrev.get(MIMETYPE)
+            if contenttype is None:
+                # if we didn't get contenttype info, thus reusing the one from current rev:
+                contenttype = currentrev.get(CONTENTTYPE)
         except NoSuchRevisionError:
             rev_no = -1
         new_rev_no = rev_no + 1
@@ -431,11 +431,11 @@
         comment = unicode(comment or meta.get(COMMENT, ''))
         if comment:
             newrev[COMMENT] = comment
-        # allow override by form- / qs-given mimetype:
-        mimetype = request.values.get('mimetype', mimetype)
+        # allow override by form- / qs-given contenttype:
+        contenttype = request.values.get('contenttype', contenttype)
         # allow override by give metadata:
-        assert mimetype is not None
-        newrev[MIMETYPE] = unicode(meta.get(MIMETYPE, mimetype))
+        assert contenttype is not None
+        newrev[CONTENTTYPE] = unicode(meta.get(CONTENTTYPE, contenttype))
         newrev[ACTION] = unicode(action)
         self.before_revision_commit(newrev, data)
         storage_item.commit()
@@ -503,14 +503,14 @@
 
         # We only want the sub-item part of the item names, not the whole item objects.
         prefix_len = len(prefix)
-        items = [(item.name, item.name[prefix_len:], item.meta.get(MIMETYPE))
+        items = [(item.name, item.name[prefix_len:], item.meta.get(CONTENTTYPE))
                  for item in item_iterator]
         return sorted(items)
 
     def flat_index(self):
         index = self.get_index()
-        index = [(fullname, relname, mimetype)
-                 for fullname, relname, mimetype in index
+        index = [(fullname, relname, contenttype)
+                 for fullname, relname, contenttype in index
                  if u'/' not in relname]
         return index
 
@@ -519,7 +519,7 @@
 
 class NonExistent(Item):
     supported_mimetypes = ['application/x-nonexistent']
-    mimetype_groups = [
+    contenttype_groups = [
         ('markup text items', [
             ('text/x.moin.wiki', 'Wiki (MoinMoin)'),
             ('text/x.moin.creole', 'Wiki (Creole)'),
@@ -576,7 +576,7 @@
         # XXX think about and add item template support
         return render_template('modify_show_type_selection.html',
                                item_name=self.name,
-                               mimetype_groups=self.mimetype_groups,
+                               contenttype_groups=self.contenttype_groups,
                               )
 
 
@@ -601,12 +601,12 @@
     def _render_meta(self):
         return "<pre>%s</pre>" % escape(self.meta_dict_to_text(self.meta, use_filter=False))
 
-    def get_templates(self, mimetype=None):
-        """ create a list of templates (for some specific mimetype) """
+    def get_templates(self, contenttype=None):
+        """ create a list of templates (for some specific contenttype) """
         from MoinMoin.storage.terms import AND, LastRevisionMetaDataMatch
         term = LastRevisionMetaDataMatch(TAGS, ['template']) # XXX there might be other tags
-        if mimetype:
-            term = AND(term, LastRevisionMetaDataMatch(MIMETYPE, mimetype))
+        if contenttype:
+            term = AND(term, LastRevisionMetaDataMatch(CONTENTTYPE, contenttype))
         item_iterator = self.search_items(term)
         items = [item.name for item in item_iterator]
         return sorted(items)
@@ -645,8 +645,8 @@
     _render_data_diff_raw = _render_data_diff
 
     def _convert(self):
-        return _("Impossible to convert the data to the mimetype: %(mimetype)s",
-                 mimetype=request.values.get('mimetype'))
+        return _("Impossible to convert the data to the contenttype: %(contenttype)s",
+                 contenttype=request.values.get('contenttype'))
 
     def do_get(self):
         hash = self.rev.get(HASH_ALGORITHM)
@@ -671,7 +671,7 @@
         else: # content = item revision
             rev = self.rev
             try:
-                mimestr = rev[MIMETYPE]
+                mimestr = rev[CONTENTTYPE]
             except KeyError:
                 mimestr = mimetypes.guess_type(rev.item.name)[0]
             mt = MimeType(mimestr=mimestr)
@@ -760,9 +760,9 @@
             raise StorageError(msg)
         if tf_members == expected_members:
             # everything we expected has been added to the tar file, save the container as revision
-            meta = {"mimetype": self.mimetype}
+            meta = {CONTENTTYPE: self.contenttype}
             data = open(temp_fname, 'rb')
-            self._save(meta, data, name=self.name, action=u'SAVE', mimetype=self.mimetype, comment='')
+            self._save(meta, data, name=self.name, action=u'SAVE', contenttype=self.contenttype, comment='')
             data.close()
             os.remove(temp_fname)
 
@@ -921,7 +921,7 @@
                             width=width, height=height, transpose=transpose)
             c = app.cache.get(cid)
             if c is None:
-                content_type = self.rev[MIMETYPE]
+                content_type = self.rev[CONTENTTYPE]
                 size = (width or 99999, height or 99999)
                 content_type, data = self._transform(content_type, size=size, transpose_op=transpose)
                 headers = wikiutil.file_headers(content_type=content_type, content_length=len(data))
@@ -951,7 +951,7 @@
             if PIL is None:
                 abort(404)
 
-            content_type = newrev[MIMETYPE]
+            content_type = newrev[CONTENTTYPE]
             if content_type == 'image/jpeg':
                 output_type = 'JPEG'
             elif content_type == 'image/png':
@@ -1035,7 +1035,7 @@
         data_text = self.data_storage_to_internal(self.data)
         # TODO: use registry as soon as it is in there
         from MoinMoin.converter.pygments_in import Converter as PygmentsConverter
-        pygments_conv = PygmentsConverter(mimetype=self.mimetype)
+        pygments_conv = PygmentsConverter(mimetype=self.contenttype)
         doc = pygments_conv(data_text.split(u'\n'))
         # TODO: Real output format
         html_conv = reg.get(type_moin_document, Type('application/x-xhtml-moin-page'))
@@ -1087,7 +1087,7 @@
 
         from MoinMoin.converter import default_registry as reg
 
-        input_conv = reg.get(Type(self.mimetype), type_moin_document)
+        input_conv = reg.get(Type(self.contenttype), type_moin_document)
         item_conv = reg.get(type_moin_document, type_moin_document,
                 items='refs', url_root=Iri(request.url_root))
 
--- a/MoinMoin/items/_tests/test_Item.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/items/_tests/test_Item.py	Sat May 07 20:22:30 2011 +0200
@@ -12,40 +12,40 @@
 
 from MoinMoin._tests import become_trusted
 from MoinMoin.items import Item, ApplicationXTar, NonExistent, Binary, Text, Image, TransformableBitmapImage
-from MoinMoin.config import MIMETYPE, ADDRESS, COMMENT, HOSTNAME, USERID, ACTION
+from MoinMoin.config import CONTENTTYPE, ADDRESS, COMMENT, HOSTNAME, USERID, ACTION
 
 class TestItem(object):
     def testNonExistent(self):
         item = Item.create('DoesNotExist')
         assert isinstance(item, NonExistent)
         meta, data = item.meta, item.data
-        assert meta == {MIMETYPE: 'application/x-nonexistent'}
+        assert meta == {CONTENTTYPE: 'application/x-nonexistent'}
         assert data == ''
 
     def testClassFinder(self):
-        for mimetype, ExpectedClass in [
+        for contenttype, ExpectedClass in [
                 ('application/x-foobar', Binary),
                 ('text/plain', Text),
                 ('image/tiff', Image),
                 ('image/png', TransformableBitmapImage),
             ]:
-            item = Item.create('foo', mimetype=mimetype)
+            item = Item.create('foo', contenttype=contenttype)
             assert isinstance(item, ExpectedClass)
 
     def testCRUD(self):
         name = u'NewItem'
-        mimetype = 'text/plain'
+        contenttype = 'text/plain'
         data = 'foobar'
         meta = dict(foo='bar')
         comment = u'saved it'
         become_trusted()
         item = Item.create(name)
         # save rev 0
-        item._save(meta, data, mimetype=mimetype, comment=comment)
+        item._save(meta, data, contenttype=contenttype, comment=comment)
         # check save result
         item = Item.create(name)
         saved_meta, saved_data = dict(item.meta), item.data
-        assert saved_meta[MIMETYPE] == mimetype
+        assert saved_meta[CONTENTTYPE] == contenttype
         assert saved_meta[COMMENT] == comment
         assert saved_data == data
         assert item.rev.revno == 0
@@ -53,11 +53,11 @@
         data = rev1_data = data * 10000
         comment = comment + u' again'
         # save rev 1
-        item._save(meta, data, mimetype=mimetype, comment=comment)
+        item._save(meta, data, contenttype=contenttype, comment=comment)
         # check save result
         item = Item.create(name)
         saved_meta, saved_data = dict(item.meta), item.data
-        assert saved_meta[MIMETYPE] == mimetype
+        assert saved_meta[CONTENTTYPE] == contenttype
         assert saved_meta[COMMENT] == comment
         assert saved_data == data
         assert item.rev.revno == 1
@@ -65,11 +65,11 @@
         data = ''
         comment = 'saved empty data'
         # save rev 2 (auto delete)
-        item._save(meta, data, mimetype=mimetype, comment=comment)
+        item._save(meta, data, contenttype=contenttype, comment=comment)
         # check save result
         item = Item.create(name)
         saved_meta, saved_data = dict(item.meta), item.data
-        assert saved_meta[MIMETYPE] == mimetype
+        assert saved_meta[CONTENTTYPE] == contenttype
         assert saved_meta[COMMENT] == comment
         assert saved_data == data
         assert item.rev.revno == 2
@@ -83,7 +83,7 @@
         basename = u'Foo'
         for name in ['', '/ab', '/cd/ef', '/gh', '/ij/kl', ]:
             item = Item.create(basename + name)
-            item._save({}, "foo", mimetype='text/plain')
+            item._save({}, "foo", contenttype='text/plain')
 
         # check index
         baseitem = Item.create(basename)
@@ -108,14 +108,14 @@
         creates a container and tests the content saved to the container
         """
         item_name = u'ContainerItem1'
-        item = Item.create(item_name, mimetype='application/x-tar')
+        item = Item.create(item_name, contenttype='application/x-tar')
         filecontent = 'abcdefghij'
         content_length = len(filecontent)
         members = set(['example1.txt', 'example2.txt'])
         item.put_member('example1.txt', filecontent, content_length, expected_members=members)
         item.put_member('example2.txt', filecontent, content_length, expected_members=members)
 
-        item = Item.create(item_name, mimetype='application/x-tar')
+        item = Item.create(item_name, contenttype='application/x-tar')
         tf_names = set(item.list_members())
         assert tf_names == members
         assert item.get_member('example1.txt').read() == filecontent
@@ -125,7 +125,7 @@
         creates two revisions of a container item
         """
         item_name = u'ContainerItem2'
-        item = Item.create(item_name, mimetype='application/x-tar')
+        item = Item.create(item_name, contenttype='application/x-tar')
         filecontent = 'abcdefghij'
         content_length = len(filecontent)
         members = set(['example1.txt'])
@@ -137,7 +137,7 @@
         item = flaskg.storage.get_item(item_name)
         assert item.next_revno == 2
 
-        item = Item.create(item_name, mimetype='application/x-tar')
+        item = Item.create(item_name, contenttype='application/x-tar')
         assert item.get_member('example1.txt').read() == filecontent
 
 coverage_modules = ['MoinMoin.items']
--- a/MoinMoin/script/maint/create_item.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/script/maint/create_item.py	Sat May 07 20:22:30 2011 +0200
@@ -12,6 +12,7 @@
 from flask import g as flaskg
 from flaskext.script import Command, Option
 
+from MoinMoin.config import NAME, ACTION, CONTENTTYPE
 from MoinMoin.storage.error import ItemAlreadyExistsError, NoSuchItemError
 
 
@@ -22,13 +23,13 @@
             help='Name of the item to create'),
         Option('--file', '-f', dest='data_file', type=unicode, required=True,
             help='Filename of file to read in and store as item.'),
-        Option('--mimetype', '-m', dest='mimetype', type=unicode, required=True,
-            help='mimetype of item'),
+        Option('--contenttype', '-m', dest='contenttype', type=unicode, required=True,
+            help='contenttype of item'),
         Option('--comment', '-c', dest='comment', type=unicode,
             help='comment for item')
     )
 
-    def run(self, name, data_file, mimetype, comment):
+    def run(self, name, data_file, contenttype, comment):
         storage = app.unprotected_storage
         rev_no = -1
         try:
@@ -38,9 +39,9 @@
             currentrev = item.get_revision(-1)
             rev_no = currentrev.revno
         rev = item.create_revision(rev_no + 1)
-        rev['action'] = u'SAVE'
-        rev['name'] = name
-        rev['mimetype'] = mimetype
+        rev[ACTION] = u'SAVE'
+        rev[NAME] = name
+        rev[CONTENTTYPE] = contenttype
         with open(data_file, 'rb') as data:
             rev.write(data.read())
             item.commit()
--- a/MoinMoin/storage/_tests/test_backends_fs19.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/storage/_tests/test_backends_fs19.py	Sat May 07 20:22:30 2011 +0200
@@ -13,7 +13,7 @@
 
 from flask import current_app as app
 
-from MoinMoin.config import TAGS
+from MoinMoin.config import CONTENTTYPE, TAGS
 from MoinMoin.storage import Item
 from MoinMoin.storage.backends._fsutils import quoteWikinameFS, unquoteWikiname
 from MoinMoin.storage.backends.fs19 import FSPageBackend, regenerate_acl, process_categories
@@ -271,7 +271,7 @@
         ]
         item_category_regex = re.compile(ur'(?P<all>Category(?P<key>(?!Template)\S+))', re.UNICODE)
         for data, expected_data, expected_tags in tests:
-            meta = dict(MIMETYPE='text/x.moin.wiki')
+            meta = {CONTENTTYPE: 'text/x.moin.wiki'}
             data = process_categories(meta, data, item_category_regex)
             assert meta.get(TAGS, []) == expected_tags
             assert data == expected_data
--- a/MoinMoin/storage/_tests/test_terms.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/storage/_tests/test_terms.py	Sat May 07 20:22:30 2011 +0200
@@ -8,6 +8,7 @@
 
 import re
 
+from MoinMoin.config import NAME, CONTENTTYPE
 from MoinMoin.storage import terms as term
 from MoinMoin.storage.backends.memory import MemoryBackend
 
@@ -60,7 +61,7 @@
 
     rev = item.create_revision(0)
     md = _lastrevision_metadata[iname]
-    rev.update(dict(name=iname, mimetype=u"application/octet-stream"))
+    rev.update({NAME: iname, CONTENTTYPE: u"application/octet-stream"})
     rev.update(md)
     rev.write(_item_contents[iname])
     item.commit()
--- a/MoinMoin/storage/backends/_flatutils.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/storage/backends/_flatutils.py	Sat May 07 20:22:30 2011 +0200
@@ -5,7 +5,7 @@
     MoinMoin - helpers for flatfile meta/data stores
 """
 
-from MoinMoin.config import NAME, ACL, MIMETYPE, MTIME, LANGUAGE
+from MoinMoin.config import NAME, ACL, CONTENTTYPE, MTIME, LANGUAGE
 
 
 def split_body(body):
@@ -58,7 +58,7 @@
     """
     Adds the processing instructions to the data.
     """
-    meta_keys = [NAME, ACL, MIMETYPE, MTIME, LANGUAGE, ]
+    meta_keys = [NAME, ACL, CONTENTTYPE, MTIME, LANGUAGE, ]
 
     metadata_data = ""
     for key, value in metadata.iteritems():
--- a/MoinMoin/storage/backends/fileserver.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/storage/backends/fileserver.py	Sat May 07 20:22:30 2011 +0200
@@ -24,7 +24,7 @@
 from MoinMoin.storage.error import NoSuchItemError, NoSuchRevisionError
 from MoinMoin.util.mimetype import MimeType
 
-from MoinMoin.config import ACL, MIMETYPE, ACTION, COMMENT, MTIME, SIZE
+from MoinMoin.config import ACL, CONTENTTYPE, ACTION, COMMENT, MTIME, SIZE
 
 class FSError(Exception):
     """ file serving backend error """
@@ -168,7 +168,7 @@
     def __init__(self, item, revno):
         FileDirRevision.__init__(self, item, revno)
         self._fs_meta.update({
-            MIMETYPE: 'text/x.moin.wiki',
+            CONTENTTYPE: 'text/x.moin.wiki',
         })
         # create a directory "page" in wiki markup:
         try:
@@ -196,8 +196,8 @@
     """ A filesystem file """
     def __init__(self, item, revno):
         FileDirRevision.__init__(self, item, revno)
-        mimetype = MimeType(filename=self._fs_data_fname).mime_type()
+        contenttype = MimeType(filename=self._fs_data_fname).mime_type()
         self._fs_meta.update({
-            MIMETYPE: mimetype,
+            CONTENTTYPE: contenttype,
         })
 
--- a/MoinMoin/storage/backends/flatfile.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/storage/backends/flatfile.py	Sat May 07 20:22:30 2011 +0200
@@ -33,7 +33,7 @@
                                    RevisionAlreadyExistsError
 from MoinMoin.storage.backends._fsutils import quoteWikinameFS, unquoteWikiname
 from MoinMoin.storage.backends._flatutils import add_metadata_to_body, split_body
-from MoinMoin.config import MIMETYPE, ACTION, MTIME
+from MoinMoin.config import ACTION, MTIME
 
 
 class FlatFileBackend(Backend):
--- a/MoinMoin/storage/backends/fs19.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/storage/backends/fs19.py	Sat May 07 20:22:30 2011 +0200
@@ -32,7 +32,7 @@
 logging = log.getLogger(__name__)
 
 from MoinMoin import config
-from MoinMoin.config import ACL, MIMETYPE, UUID, NAME, NAME_OLD, REVERTED_TO, \
+from MoinMoin.config import ACL, CONTENTTYPE, UUID, NAME, NAME_OLD, REVERTED_TO, \
                             ACTION, ADDRESS, HOSTNAME, USERID, MTIME, EXTRA, COMMENT, \
                             IS_SYSITEM, SYSITEM_VERSION, \
                             TAGS, SIZE, HASH_ALGORITHM
@@ -46,12 +46,12 @@
 DELETED_MODE_KEEP = 'keep'
 DELETED_MODE_KILL = 'kill'
 
-mimetype_default = u'text/plain'
-mimetype_moinwiki = u'text/x.moin.wiki'
-format_to_mimetype = {
+CONTENTTYPE_DEFAULT = u'text/plain'
+CONTENTTYPE_MOINWIKI = u'text/x.moin.wiki'
+FORMAT_TO_CONTENTTYPE = {
     'wiki': u'text/x.moin.wiki',
-    'text/wiki': mimetype_moinwiki,
-    'text/moin-wiki': mimetype_moinwiki,
+    'text/wiki': CONTENTTYPE_MOINWIKI,
+    'text/moin-wiki': CONTENTTYPE_MOINWIKI,
     'creole': u'text/x.moin.creole',
     'text/creole': u'text/x.moin.creole',
     'rst': u'text/rst',
@@ -350,7 +350,7 @@
                 # if this page revision is deleted, we have no on-page metadata.
                 # but some metadata is required, thus we have to copy it from the
                 # (non-deleted) revision revno-1:
-                for key in [ACL, NAME, MIMETYPE, MTIME, ]:
+                for key in [ACL, NAME, CONTENTTYPE, MTIME, ]:
                     if key in previous_meta:
                         meta[key] = previous_meta[key]
             except NoSuchRevisionError:
@@ -380,7 +380,7 @@
             meta, data = split_body(content)
         meta.update(editlog_data)
         format = meta.pop('format', backend.format_default)
-        meta[MIMETYPE] = format_to_mimetype.get(format, mimetype_default)
+        meta[CONTENTTYPE] = FORMAT_TO_CONTENTTYPE.get(format, CONTENTTYPE_DEFAULT)
         if item._syspages:
             meta[IS_SYSITEM] = True
             meta[SYSITEM_VERSION] = item._syspages
@@ -406,7 +406,7 @@
             E.g. categories are stored in the footer of the page content. For
             moin2, we extract that stuff from content and put it into metadata.
         """
-        if meta[MIMETYPE] == mimetype_moinwiki:
+        if meta[CONTENTTYPE] == CONTENTTYPE_MOINWIKI:
             data = process_categories(meta, data, self._backend.item_category_regex)
         return data
 
@@ -492,7 +492,7 @@
         # attachments in moin 1.9 were protected by their "parent" page's acl
         if item._fs_parent_acl is not None:
             meta[ACL] = item._fs_parent_acl # XXX not needed for acl_hierarchic
-        meta[MIMETYPE] = unicode(MimeType(filename=item._fs_attachname).mime_type())
+        meta[CONTENTTYPE] = unicode(MimeType(filename=item._fs_attachname).mime_type())
         with open(attpath, 'rb') as f:
             size, hash_name, hash_digest = hash_hexdigest(f)
         meta[hash_name] = hash_digest
--- a/MoinMoin/storage/backends/indexing.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/storage/backends/indexing.py	Sat May 07 20:22:30 2011 +0200
@@ -30,7 +30,7 @@
 
 from MoinMoin.storage.error import NoSuchItemError, NoSuchRevisionError, \
                                    AccessDeniedError
-from MoinMoin.config import ACL, MIMETYPE, UUID, NAME, NAME_OLD, MTIME, TAGS
+from MoinMoin.config import ACL, CONTENTTYPE, UUID, NAME, NAME_OLD, MTIME, TAGS
 
 
 class IndexingBackendMixin(object):
@@ -179,8 +179,8 @@
             self[NAME] = name
         if UUID not in self:
             self[UUID] = uuid # do we want the item's uuid in the rev's metadata?
-        if MIMETYPE not in self:
-            self[MIMETYPE] = 'application/octet-stream'
+        if CONTENTTYPE not in self:
+            self[CONTENTTYPE] = 'application/octet-stream'
         metas = self
         logging.debug("item %r revno %d update index:" % (name, revno))
         for k, v in metas.items():
@@ -229,7 +229,7 @@
             Column('uuid', String(UUID_LEN), index=True, unique=True), # item's official persistent uuid
             # from current revision's metadata:
             Column('name', Unicode(VALUE_LEN), index=True, unique=True),
-            Column('mimetype', Unicode(VALUE_LEN), index=True),
+            Column('contenttype', Unicode(VALUE_LEN), index=True),
             Column('acl', Unicode(VALUE_LEN)),
             Column('tags', Unicode(VALUE_LEN)),
         )
@@ -300,7 +300,7 @@
         item_table.update().where(item_table.c.id == item_id).values(
             current=rev_id,
             name=rev_metas[NAME],
-            mimetype=rev_metas[MIMETYPE],
+            contenttype=rev_metas[CONTENTTYPE],
             acl=rev_metas.get(ACL, ''),
             tags=u'|' + u'|'.join(rev_metas.get(TAGS, [])) + u'|',
         ).execute()
--- a/MoinMoin/templates/global_history.html	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/templates/global_history.html	Sat May 07 20:22:30 2011 +0200
@@ -15,7 +15,7 @@
                 <th>{{ _("Action") }}</th>
                 <th>{{ _("Name") }}</th>
                 <th>{{ _("Rev.") }}</th>
-                <th>{{ _("Mime Type") }}</th>
+                <th>{{ _("Content-Type") }}</th>
                 <th>{{ _("Editor") }}</th>
                 <th>{{ _("Comment") }}</th>
             </tr>
@@ -28,7 +28,7 @@
             <td class="moin-wordbreak"><a href="{{ url_for('frontend.show_item', item_name=rev.item.name) }}">{{ rev.item.name }}</a>
                 {% if rev.item.name != rev.name %} ({{ rev.name }}){% endif %}</td>
             <td class="moin-integer">{{ rev.revno }}</td>
-            <td class="moin-wordbreak">{{ rev.mimetype }}</td>
+            <td class="moin-wordbreak">{{ rev.contenttype }}</td>
             <td class="moin-wordbreak">{{ utils.editor_info(rev) }}</td>
             <td class="moin-wordbreak">{{ rev.comment }}</td>
         </tr>
--- a/MoinMoin/templates/global_index.html	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/templates/global_index.html	Sat May 07 20:22:30 2011 +0200
@@ -4,10 +4,10 @@
     <h1>{{ _("Global Index") }}</h1>
     {% if index %}
         <ul>
-        {% for fullname, relname, mimetype in index %}
+        {% for fullname, relname, contenttype in index %}
             <li>
                 <a href="{{ url_for('show_item', item_name=fullname) }}"
-                   class="{{ mimetype|mimetype_to_class }}">
+                   class="{{ contenttype|contenttype_to_class }}">
                     {{ relname }}
                 </a>
             </li>
--- a/MoinMoin/templates/history.html	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/templates/history.html	Sat May 07 20:22:30 2011 +0200
@@ -13,7 +13,7 @@
                 <th>{{ _("Size") }}</th>
                 <th><input type="submit" value="Diff" /></th>
                 <th>{{ _("Editor") }}</th>
-                <th>{{ _("Mime Type") }}</th>
+                <th>{{ _("Content-Type") }}</th>
                 <th>{{ _("Comment") }}</th>
                 <th colspan="6">{{ _("Actions") }}</th>
             </tr>
@@ -30,7 +30,7 @@
                     </div>
                 </td>
                 <td class="moin-wordbreak">{{ utils.editor_info(rev) }}</td>
-                <td class="moin-wordbreak">{{ rev.mimetype }}</td>
+                <td class="moin-wordbreak">{{ rev.contenttype }}</td>
                 <td class="moin-wordbreak">{{ rev.comment }}</td>
                 <td><a href="{{ url_for('frontend.show_item', item_name=rev.item.name, rev=rev.revno) }}">{{ _('show') }}</a></td>
                 <td><a href="{{ url_for('frontend.show_item_meta', item_name=rev.item.name, rev=rev.revno) }}">{{ _('meta') }}</a></td>
--- a/MoinMoin/templates/index.html	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/templates/index.html	Sat May 07 20:22:30 2011 +0200
@@ -4,10 +4,10 @@
     <h1>{{ _("Index of subitems of '%(item_name)s'", item_name=item_name) }}</h1>
     {% if index %}
         <ul>
-        {% for fullname, relname, mimetype in index %}
+        {% for fullname, relname, contenttype in index %}
             <li>
                 <a href="{{ url_for('show_item', item_name=fullname) }}"
-                   class="{{ mimetype|mimetype_to_class }}">
+                   class="{{ contenttype|contenttype_to_class }}">
                     {{ relname }}
                 </a>
             </li>
--- a/MoinMoin/templates/modify_anywikidraw.html	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/templates/modify_anywikidraw.html	Sat May 07 20:22:30 2011 +0200
@@ -9,7 +9,7 @@
 <param name="DrawingURL" value="{{ url_for('frontend.get_item', item_name=item_name, member='drawing.svg') }}" />
 {% endif %}
 <param name="PageURL" value="{{ url_for('frontend.show_item', item_name=item_name) }}" />
-<param name="UploadURL" value="{{ url_for('frontend.modify_item', item_name=item_name, mimetype='application/x-anywikidraw') }}" />
+<param name="UploadURL" value="{{ url_for('frontend.modify_item', item_name=item_name, contenttype='application/x-anywikidraw') }}" />
 <param name="Locale" value="en" />
 <param name="codebase_lookup" value="false" />
 <param name="classloader_cache" value="false" />
--- a/MoinMoin/templates/modify_show_template_selection.html	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/templates/modify_show_template_selection.html	Sat May 07 20:22:30 2011 +0200
@@ -3,13 +3,13 @@
 <h1>{{ _("Create new item?") }}</h1>
 <p>
 {{ _("You can either <a href='%(modifyhref)s'>create the item from scratch</a> or select a template.",
-modifyhref=url_for('frontend.modify_item', item_name=item_name, mimetype=mimetype, template='') ) }}
+modifyhref=url_for('frontend.modify_item', item_name=item_name, contenttype=contenttype, template='') ) }}
 </p>
 <h2>{{ _("Available template items") }}</h2>
 <ul>
     {% for template in templates %}
     <li>
-    <a href="{{ url_for('frontend.modify_item', item_name=item_name, mimetype=mimetype, template=template) }}">{{ template }}</a>
+    <a href="{{ url_for('frontend.modify_item', item_name=item_name, contenttype=contenttype, template=template) }}">{{ template }}</a>
     </li>
     {% endfor %}
 </ul>
--- a/MoinMoin/templates/modify_show_type_selection.html	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/templates/modify_show_type_selection.html	Sat May 07 20:22:30 2011 +0200
@@ -5,14 +5,14 @@
 {{ _("This item does not exist (yet), but you can try creating it now. Please select the type of the item you want to create.") }}
 </p>
 <table>
-    {% for gname, mimetypes in mimetype_groups %}
+    {% for gname, contenttypes in contenttype_groups %}
     <tr>
         <td class="green">{{ gname }}</td>
     </tr>
     <tr>
         <td>
-        {% for mname, mlabel in mimetypes %}
-            <a href="{{ url_for('frontend.modify_item', item_name=item_name, mimetype=mname) }}">{{ mlabel }}</a> -
+        {% for ctname, ctlabel in contenttypes %}
+            <a href="{{ url_for('frontend.modify_item', item_name=item_name, contenttype=ctname) }}">{{ ctlabel }}</a> -
         {% endfor %}
         </td>
     </tr>
--- a/MoinMoin/templates/modify_twikidraw.html	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/templates/modify_twikidraw.html	Sat May 07 20:22:30 2011 +0200
@@ -6,7 +6,7 @@
         width="800" height="620">
         <param name="drawpath" value="{{ url_for('frontend.get_item', item_name=item_name, member='drawing.draw') }}" />
         <param name="pngpath"  value="{{ url_for('frontend.get_item', item_name=item_name, member='drawing.png') }}" />
-<param name="savepath" value="{{ url_for('frontend.modify_item', item_name=item_name, mimetype='application/x-twikidraw') }}" />
+<param name="savepath" value="{{ url_for('frontend.modify_item', item_name=item_name, contenttype='application/x-twikidraw') }}" />
 <param name="basename" value="drawing" />
 <param name="viewpath" value="{{ url_for('frontend.show_item', item_name=item_name) }}" />
 <param name="helppath" value="" />
--- a/MoinMoin/themes/__init__.py	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/themes/__init__.py	Sat May 07 20:22:30 2011 +0200
@@ -361,20 +361,20 @@
     'application/pdf': 'pdf',
 }
 
-def mimetype_to_class(mimetype):
+def contenttype_to_class(contenttype):
     """
-    Convert a mimetype string to a css class.
+    Convert a contenttype string to a css class.
     """
-    cls = MIMETYPE_TO_CLASS.get(mimetype)
+    cls = MIMETYPE_TO_CLASS.get(contenttype)
     if not cls:
         # just use the major part of mimetype
-        cls = mimetype.split('/', 1)[0]
+        cls = contenttype.split('/', 1)[0]
     return 'moin-mime-%s' % cls
 
 
 def setup_jinja_env():
     app.jinja_env.filters['shorten_item_name'] = shorten_item_name
-    app.jinja_env.filters['mimetype_to_class'] = mimetype_to_class
+    app.jinja_env.filters['contenttype_to_class'] = contenttype_to_class
     # please note that these filters are installed by flask-babel:
     # datetimeformat, dateformat, timeformat, timedeltaformat
 
--- a/MoinMoin/translations/MoinMoin.pot	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/translations/MoinMoin.pot	Sat May 07 20:22:30 2011 +0200
@@ -873,7 +873,7 @@
 msgstr ""
 
 #: MoinMoin/templates/global_history.html:18 MoinMoin/templates/history.html:16
-msgid "Mime Type"
+msgid "Content-Type"
 msgstr ""
 
 #: MoinMoin/templates/global_history.html:19 MoinMoin/templates/history.html:15
--- a/MoinMoin/translations/de/LC_MESSAGES/messages.po	Wed May 04 01:32:54 2011 +0200
+++ b/MoinMoin/translations/de/LC_MESSAGES/messages.po	Sat May 07 20:22:30 2011 +0200
@@ -920,8 +920,8 @@
 msgstr "Rev."
 
 #: MoinMoin/templates/global_history.html:18 MoinMoin/templates/history.html:16
-msgid "Mime Type"
-msgstr "MIME-Typ"
+msgid "Content-Type"
+msgstr "Content-Type"
 
 #: MoinMoin/templates/global_history.html:19 MoinMoin/templates/history.html:15
 msgid "Editor"