Commit 5ec7fc53 authored by Bartek Górny's avatar Bartek Górny

fixed workflow status implementation

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12199 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 84d9a667
...@@ -29,8 +29,11 @@ from AccessControl import ClassSecurityInfo ...@@ -29,8 +29,11 @@ from AccessControl import ClassSecurityInfo
from Products.CMFCore.WorkflowCore import WorkflowMethod from Products.CMFCore.WorkflowCore import WorkflowMethod
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.Document import Document 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 htmlentitydefs import name2codepoint
from DateTime import DateTime from DateTime import DateTime
...@@ -123,6 +126,7 @@ class ExternalDocument(Document): ...@@ -123,6 +126,7 @@ class ExternalDocument(Document):
sets status message sets status message
returned value tells us if it succeeded or failed returned value tells us if it succeeded or failed
""" """
portal_workflow = getToolByName(self, 'portal_workflow')
try: try:
s,inf=self._spiderSource() s,inf=self._spiderSource()
except Exception,e: except Exception,e:
......
...@@ -35,8 +35,6 @@ from Products.CMFCore.utils import getToolByName ...@@ -35,8 +35,6 @@ from Products.CMFCore.utils import getToolByName
import mimetypes, re, urllib import mimetypes, re, urllib
from htmlentitydefs import name2codepoint from htmlentitydefs import name2codepoint
portal_workflow = getToolByName('portal_workflow')
rx=[] rx=[]
rx.append(re.compile('<!--.*?-->',re.DOTALL|re.MULTILINE)) # clear comments (sometimes JavaScript code in comments contains > chars) rx.append(re.compile('<!--.*?-->',re.DOTALL|re.MULTILINE)) # clear comments (sometimes JavaScript code in comments contains > chars)
rx.append(re.compile('<[^>]*?>',re.DOTALL|re.MULTILINE)) # clear tags rx.append(re.compile('<[^>]*?>',re.DOTALL|re.MULTILINE)) # clear tags
...@@ -206,6 +204,7 @@ class ExternalWebPage(ExternalDocument): ...@@ -206,6 +204,7 @@ class ExternalWebPage(ExternalDocument):
s=recode(s) s=recode(s)
except CanNotDecode: except CanNotDecode:
msg = "Spidered on %s, %i chars, but could not decode" % (self._time(), chars) 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) portal_workflow.doActionFor(context, 'process', comment=msg)
return False return False
s=stripHtml(s) # remove headers, doctype and the like s=stripHtml(s) # remove headers, doctype and the like
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment