changeset 5687:bf0b4b96dcb4

Merged moin/1.8
author Eugene Syromyatnikov <evgsyr@gmail.com>
date Fri, 04 Jun 2010 18:55:17 +0400
parents 60fde500cbc2 (current diff) 4238b0c90871 (diff)
children 80c5a662e132
files MoinMoin/Page.py MoinMoin/PageEditor.py MoinMoin/PageGraphicalEditor.py MoinMoin/action/CopyPage.py MoinMoin/action/LikePages.py MoinMoin/action/Load.py MoinMoin/action/RenamePage.py MoinMoin/action/backup.py MoinMoin/action/chart.py MoinMoin/action/login.py MoinMoin/action/newaccount.py MoinMoin/action/recoverpass.py MoinMoin/action/userprofile.py MoinMoin/userprefs/prefs.py wiki/underlay.tar
diffstat 2 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Fri Jun 04 13:29:48 2010 +0400
+++ b/MoinMoin/Page.py	Fri Jun 04 18:55:17 2010 +0400
@@ -1260,7 +1260,10 @@
             self.getFormatterName() in self.cfg.caching_formats):
             # Everything is fine, now check the parser:
             if parser is None:
-                parser = wikiutil.searchAndImportPlugin(self.request.cfg, "parser", self.pi['format'])
+                try:
+                    parser = wikiutil.searchAndImportPlugin(self.request.cfg, "parser", self.pi['format'])
+                except wikiutil.PluginMissingError:
+                    return False
             return getattr(parser, 'caching', False)
         return False
 
@@ -1275,7 +1278,10 @@
         """
         request.clock.start('send_page_content')
         # Load the parser
-        Parser = wikiutil.searchAndImportPlugin(request.cfg, "parser", format)
+        try:
+            Parser = wikiutil.searchAndImportPlugin(request.cfg, "parser", format)
+        except wikiutil.PluginMissingError:
+            Parser = wikiutil.searchAndImportPlugin(request.cfg, "parser", "plain")
         parser = Parser(body, request, format_args=format_args, **kw)
 
         if not (do_cache and self.canUseCache(Parser)):
--- a/MoinMoin/PageEditor.py	Fri Jun 04 13:29:48 2010 +0400
+++ b/MoinMoin/PageEditor.py	Fri Jun 04 18:55:17 2010 +0400
@@ -493,7 +493,10 @@
 
         # QuickHelp originally by Georg Mischler <schorsch@lightingwiki.com>
         markup = self.pi['format'] or request.cfg.default_markup
-        parser = wikiutil.searchAndImportPlugin(self.request.cfg, "parser", markup)
+        try:
+            parser = wikiutil.searchAndImportPlugin(self.request.cfg, "parser", markup)
+        except wikiutil.PluginMissingError:
+            parser = wikiutil.searchAndImportPlugin(self.request.cfg, "parser", "plain")
         quickhelp = getattr(parser, 'quickhelp', None)
         if quickhelp:
             request.write(request.formatter.div(1, id="editor-help"))