projects
/
Portfolio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ajout du script de traitement des requĂȘtes Lightroom.
[Portfolio.git]
/
ImageManipulationTool.py
diff --git
a/ImageManipulationTool.py
b/ImageManipulationTool.py
index
5f9fa04
..
4ec31f7
100755
(executable)
--- a/
ImageManipulationTool.py
+++ b/
ImageManipulationTool.py
@@
-9,8
+9,6
@@
# http://creativecommons.org/licenses/by-nc/2.0/ #
############################################################
""" Image manipulation tool
# http://creativecommons.org/licenses/by-nc/2.0/ #
############################################################
""" Image manipulation tool
-$Id: ImageManipulationTool.py 1391 2009-09-16 23:36:05Z pin $
-$URL: http://svn.luxia.fr/svn/labo/projects/zope/Portfolio/trunk/ImageManipulationTool.py $
"""
from AccessControl import ClassSecurityInfo
"""
from AccessControl import ClassSecurityInfo
@@
-28,9
+26,9
@@
from Products.MailHost.decorator import synchronized
import time
from logging import getLogger
from threading import Lock
import time
from logging import getLogger
from threading import Lock
+import weakref
console = getLogger('[portal_image_manipulation]')
console = getLogger('[portal_image_manipulation]')
-
-queue_threads = {}
+queue_threads = weakref.WeakValueDictionary()
class ImageManipulationTool( UniqueObject, OrderedFolder) :
class ImageManipulationTool( UniqueObject, OrderedFolder) :
@@
-102,8
+100,13
@@
class ImageManipulationTool( UniqueObject, OrderedFolder) :
if not self.isRunning() :
utool = getToolByName(self, 'portal_url')
if not self.isRunning() :
utool = getToolByName(self, 'portal_url')
+ ctool = getToolByName(self, 'portal_catalog')
portal = utool.getPortalObject()
portal = utool.getPortalObject()
- thread = ImageQueueProcessorThread(portal.getPhysicalPath(), itemPath)
+ brains = ctool.unrestrictedSearchResults(portal_type='Photo', tiles_available=0)
+ paths = [b.getPath() for b in brains]
+ if itemPath is not None :
+ paths.insert(0, itemPath)
+ thread = ImageQueueProcessorThread(portal.getPhysicalPath(), paths)
thread.start()
path = self.absolute_url(1)
queue_threads[path] = thread
thread.start()
path = self.absolute_url(1)
queue_threads[path] = thread