[Erp5-report] r42003 kazuhiko - /erp5/trunk/products/ERP5/Tool/ContributionTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jan 4 17:45:42 CET 2011


Author: kazuhiko
Date: Tue Jan  4 17:45:42 2011
New Revision: 42003

URL: http://svn.erp5.org?rev=42003&view=rev
Log:
* non-batch mode (i.e. calling from UI), we need to have exception without retrying with activity.
* remove needless duplicate code.

Modified:
    erp5/trunk/products/ERP5/Tool/ContributionTool.py

Modified: erp5/trunk/products/ERP5/Tool/ContributionTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/ContributionTool.py?rev=42003&r1=42002&r2=42003&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/ContributionTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Tool/ContributionTool.py [utf8] Tue Jan  4 17:45:42 2011
@@ -616,25 +616,13 @@ class ContributionTool(BaseTool):
         # If this is an index document, stop crawling if crawling_depth is 0
         document.activate().crawlContent()
     except urllib2.HTTPError, error:
-      if repeat == 0 and batch_mode:
+      if repeat == 0 or not batch_mode:
         # here we must call the extendBadURLList method,--NOT Implemented--
         # which had to add this url to bad URL list, so next time we avoid
         # crawling bad URL
         raise
       if repeat > 0:
         # Catch any HTTP error
-        self.activate(at_date=DateTime() + repeat_interval).newContentFromURL(
-                          container_path=container_path, url=url,
-                          repeat=repeat - 1,
-                          repeat_interval=repeat_interval, **kw)
-    except urllib2.URLError, error:
-      if repeat == 0 and batch_mode:
-        # XXX - Call the extendBadURLList method, --NOT Implemented--
-        raise
-      #if getattr(error.reason,'args',None):
-        #if error.reason.args[0] == socket.EAI_AGAIN:
-          ## Temporary failure in name resolution - try again in 1 day
-      if repeat > 0:
         self.activate(at_date=DateTime() + repeat_interval,
                       activity="SQLQueue").newContentFromURL(
                         container_path=container_path, url=url,



More information about the Erp5-report mailing list