[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/Products/SiteErrorLog/SiteErrorLog.py - replaced MessageDialog by less annoying manage_tabs_message

Yvo Schubbe y.2005- at wcm-solutions.de
Thu Jun 16 12:24:13 EDT 2005


Log message for revision 30812:
  - replaced MessageDialog by less annoying manage_tabs_message
  - some related cleanup

Changed:
  UU  Zope/branches/Zope-2_8-branch/lib/python/Products/SiteErrorLog/SiteErrorLog.py

-=-
Modified: Zope/branches/Zope-2_8-branch/lib/python/Products/SiteErrorLog/SiteErrorLog.py
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/Products/SiteErrorLog/SiteErrorLog.py	2005-06-16 16:19:33 UTC (rev 30811)
+++ Zope/branches/Zope-2_8-branch/lib/python/Products/SiteErrorLog/SiteErrorLog.py	2005-06-16 16:24:13 UTC (rev 30812)
@@ -22,7 +22,6 @@
 import logging
 from random import random
 from thread import allocate_lock
-from types import StringType, UnicodeType
 
 import Globals
 from Acquisition import aq_base
@@ -117,9 +116,6 @@
             temp_logs[self._p_oid] = log
         return log
 
-    # Exceptions that happen all the time, so we dont need
-    # to log them. Eventually this should be configured
-    # through-the-web.
     security.declareProtected(use_error_logging, 'forgetEntry')
     def forgetEntry(self, id, REQUEST=None):
         """Removes an entry from the error log."""
@@ -132,10 +128,13 @@
             i += 1
         cleanup_lock.release()
         if REQUEST is not None:
-           return Globals.MessageDialog(title='Entry removed',
-                message='Error log entry was removed.',
-                action='./manage_main',)
+            REQUEST.RESPONSE.redirect(
+                '%s/manage_main?manage_tabs_message=Error+log+entry+was+removed.' %
+                self.absolute_url())
 
+    # Exceptions that happen all the time, so we dont need
+    # to log them. Eventually this should be configured
+    # through-the-web.
     _ignored_exceptions = ( 'Unauthorized', 'NotFound', 'Redirect' )
 
     security.declarePrivate('raising')
@@ -155,8 +154,7 @@
                 if strtype in self._ignored_exceptions:
                     return
 
-                if not isinstance(info[2], StringType) and not isinstance(
-                    info[2], UnicodeType):
+                if not isinstance(info[2], basestring):
                     tb_text = ''.join(
                         format_exception(*info, **{'as_html': 0}))
                     tb_html = ''.join(


Property changes on: Zope/branches/Zope-2_8-branch/lib/python/Products/SiteErrorLog/SiteErrorLog.py
___________________________________________________________________
Name: cvs2svn:cvs-rev
   - 1.17



More information about the Zope-Checkins mailing list