[Erp5-report] r12199 - /erp5/trunk/products/ERP5/Document/

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jan 22 15:23:32 CET 2007


Author: bartek
Date: Mon Jan 22 15:23:26 2007
New Revision: 12199

URL: http://svn.erp5.org?rev=12199&view=rev
Log:
fixed workflow status implementation

Modified:
    erp5/trunk/products/ERP5/Document/ExternalDocument.py
    erp5/trunk/products/ERP5/Document/ExternalWebPage.py

Modified: erp5/trunk/products/ERP5/Document/ExternalDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/ExternalDocument.py?rev=12199&r1=12198&r2=12199&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/ExternalDocument.py (original)
+++ erp5/trunk/products/ERP5/Document/ExternalDocument.py Mon Jan 22 15:23:26 2007
@@ -29,8 +29,11 @@
 from Products.CMFCore.WorkflowCore import WorkflowMethod
 from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
 from Products.ERP5.Document.Document import Document
+from Products.CMFCore.utils import getToolByName
 
-import mimetypes, re, urllib
+import mimetypes
+import re
+import urllib
 from htmlentitydefs import name2codepoint
 from DateTime import DateTime
 
@@ -123,6 +126,7 @@
     sets status message
     returned value tells us if it succeeded or failed
     """
+    portal_workflow = getToolByName(self, 'portal_workflow')
     try:
       s,inf=self._spiderSource()
     except Exception,e:

Modified: erp5/trunk/products/ERP5/Document/ExternalWebPage.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/ExternalWebPage.py?rev=12199&r1=12198&r2=12199&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/ExternalWebPage.py (original)
+++ erp5/trunk/products/ERP5/Document/ExternalWebPage.py Mon Jan 22 15:23:26 2007
@@ -34,8 +34,6 @@
 
 import mimetypes, re, urllib
 from htmlentitydefs import name2codepoint
-
-portal_workflow = getToolByName('portal_workflow')
 
 rx=[]
 rx.append(re.compile('<!--.*?-->',re.DOTALL|re.MULTILINE)) # clear comments (sometimes JavaScript code in comments contains > chars)
@@ -206,6 +204,7 @@
       s=recode(s)
     except CanNotDecode:
       msg = "Spidered on %s, %i chars, but could not decode" % (self._time(), chars)
+      portal_workflow = getToolByName(self, 'portal_workflow')
       portal_workflow.doActionFor(context, 'process', comment=msg)
       return False
     s=stripHtml(s) # remove headers, doctype and the like




More information about the Erp5-report mailing list