summaryrefslogtreecommitdiffstats
path: root/themis
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2012-10-01 08:08:37 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2012-10-01 08:08:37 (GMT)
commit99480fb9fe5856e182c978ba83603d89d04a2cd4 (patch)
tree9aa670df7d6b6a2ca3c3c380b502bd718fd2e1c1 /themis
parent93fa1c1f46d7496d9a19fca1f17c6764aff65985 (diff)
downloadthemis.ocrloader-99480fb9fe5856e182c978ba83603d89d04a2cd4.zip
themis.ocrloader-99480fb9fe5856e182c978ba83603d89d04a2cd4.tar.gz
themis.ocrloader-99480fb9fe5856e182c978ba83603d89d04a2cd4.tar.bz2
notify new elements with added event
Diffstat (limited to 'themis')
-rw-r--r--themis/ocrloader/ocrloader.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/themis/ocrloader/ocrloader.py b/themis/ocrloader/ocrloader.py
index d0a04b5..b37355d 100644
--- a/themis/ocrloader/ocrloader.py
+++ b/themis/ocrloader/ocrloader.py
@@ -10,6 +10,10 @@ from Products.CMFCore.utils import getToolByName
from Products.Five.browser import BrowserView
from plone.namedfile.file import NamedBlobFile
+from zope.event import notify
+from zope.lifecycleevent import ObjectAddedEvent, ObjectModifiedEvent
+
+
import transaction
import themis.config.utils
@@ -133,10 +137,12 @@ class LoadFromOcr(BrowserView):
folder.invokeFactory(factory, id=ocr_id, title=ocr_title,
fichier=ocr_file, **kwargs)
-
os.rename(os.path.join(base, filename),
os.path.join(base, filename + '.processed'))
transaction.commit()
+ object = getattr(folder, ocr_id)
+ notify(ObjectAddedEvent(object))
+
return 'OK'