diff MoinMoin/formatter/__init__.py @ 1520:563bfe02b04f

Removed a lot of ugly MimeType() calls, refactored it into a helper, fixed page rendering for missing parsers.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sun, 03 Sep 2006 01:06:20 +0200
parents b1deb9496f41
children ebcebba1afb3
line wrap: on
line diff
--- a/MoinMoin/formatter/__init__.py	Sun Sep 03 00:34:29 2006 +0200
+++ b/MoinMoin/formatter/__init__.py	Sun Sep 03 01:06:20 2006 +0200
@@ -309,15 +309,8 @@
         """ parser_name MUST be valid!
             writes out the result instead of returning it!
         """
-        mt = wikiutil.MimeType(parser_name)
-        for module_name in mt.module_name():
-            try:
-                parser = wikiutil.importPlugin(self.request.cfg, "parser", module_name, "Parser")
-                break
-            except wikiutil.PluginMissingError:
-                pass
-        else:
-            raise "Parser not found" # XXX what now?
+        parser = wikiutil.searchAndImportPlugin(self.request.cfg, "parser", parser_name)
+
         args = self._get_bang_args(lines[0])
         if args is not None:
             lines = lines[1:]