Commits

xiaq  committed d4ad8f7 Merge

Automated merge with http://hg.moinmo.in/moin/2.0

  • Participants
  • Parent commits 243ce99, 8231bca

Comments (0)

Files changed (5)

File MoinMoin/converter/__init__.py

 
         def __lt__(self, other):
             if isinstance(other, self.__class__):
-                if self.priority != other.priority:
-                    return self.priority < other.priority
                 if self.type_output != other.type_output:
                     return other.type_output.issupertype(self.type_output)
                 if self.type_input != other.type_input:
                     return other.type_input.issupertype(self.type_input)
+                if self.priority != other.priority:
+                    return self.priority < other.priority
                 return False
             return NotImplemented
 

File MoinMoin/converter/everything.py

 
 from . import default_registry
 from MoinMoin.util.mime import Type, type_moin_document
-default_registry.register(Converter._factory, Type('application/octet-stream'), type_moin_document,
-                          default_registry.PRIORITY_MIDDLE + 3)
-default_registry.register(Converter._factory, Type(type=None, subtype=None), type_moin_document,
-                          default_registry.PRIORITY_MIDDLE + 3)
+default_registry.register(Converter._factory, Type('application/octet-stream'), type_moin_document)
+default_registry.register(Converter._factory, Type(type=None, subtype=None), type_moin_document)

File MoinMoin/converter/pygments_in.py

 
     from . import default_registry
     from MoinMoin.util.mime import Type, type_moin_document
-    # Pygments type detection is rather expensive, therefore we want to register
-    # after all normal parsers but before the compatibility parsers and wildcard
-    default_registry.register(Converter._factory, Type(type='text'), type_moin_document,
-                              default_registry.PRIORITY_MIDDLE + 1)
-    default_registry.register(Converter._factory, Type('x-moin/format'), type_moin_document,
-                              default_registry.PRIORITY_MIDDLE + 1)
+    default_registry.register(Converter._factory, Type(type='text'), type_moin_document)
+    default_registry.register(Converter._factory, Type('x-moin/format'), type_moin_document)
 
 else:
     # we have no Pygments, minimal Converter replacement, so highlight view does not crash

File MoinMoin/converter/text_in.py

 
 from . import default_registry
 from MoinMoin.util.mime import Type, type_moin_document
+# Assign a lower priority (= bigger number) so that it is tried after pygments_in
 default_registry.register(Converter._factory, Type(type='text'), type_moin_document,
-                          default_registry.PRIORITY_MIDDLE + 2)
+                          default_registry.PRIORITY_MIDDLE + 1)

File MoinMoin/items/content.py

 
         def __lt__(self, other):
             if isinstance(other, self.__class__):
+                if self.content_type != other.content_type:
+                    return other.content_type.issupertype(self.content_type)
                 if self.priority != other.priority:
                     return self.priority < other.priority
-                if self.content_type != other.content_type:
-                    return other.content_type.issupertype(self.content_type)
                 return False
             return NotImplemented