xiaq avatar xiaq committed d4ad8f7 Merge

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

Comments (0)

Files changed (5)

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
 

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)

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

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)

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
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.