Version initiale.
[Portfolio.git] / event_handlers.py
1 # -*- coding: utf-8 -*-
2 ####################################################
3 # Copyright © 2009 Luxia SAS. All rights reserved. #
4 # #
5 # Contributors: #
6 # - Benoît Pin <pinbe@luxia.fr> #
7 ####################################################
8 """ Event handlers module
9
10 $Id: event_handlers.py 1391 2009-09-16 23:36:05Z pin $
11 $URL: http://svn.luxia.fr/svn/labo/projects/zope/Portfolio/trunk/event_handlers.py $
12 """
13
14 import transaction
15 from Products.CMFCore.utils import getToolByName
16
17 def processQueueAdd(ob, event) :
18 pimtool = getToolByName(ob, 'portal_image_manipulation')
19 path = '/'.join(ob.getPhysicalPath())
20
21 def hook(success) :
22 if success:
23 pimtool._queueAdd(path)
24
25 transaction.get().addAfterCommitHook(hook)