]> CRI, Mines Paris - PSL - Portfolio.git/commitdiff
validation des test et nettoyage
authorBenoît Pin <benoit.pin@gmail.com>
Tue, 27 Apr 2010 19:52:04 +0000 (21:52 +0200)
committerBenoît Pin <benoit.pin@gmail.com>
Tue, 27 Apr 2010 19:52:04 +0000 (21:52 +0200)
Les tests fonctionnels passent pour la génération des tuiles, nettoyages.

ImageManipulationTool.py
Portfolio.py
__init__.py
container.py
event_handlers.py
interfaces.py
lightbox.py
manipulation.py
photo.py
utils.py

index 9c3458063de9bb2c77a3a8f755d65cc5ee321b7a..4ec31f731e5f6d5dbb3cb2b580ada80a764b5b7a 100755 (executable)
@@ -9,8 +9,6 @@
 # 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
@@ -102,8 +100,13 @@ class ImageManipulationTool( UniqueObject, OrderedFolder) :
                
                if not self.isRunning() :
                        utool = getToolByName(self, 'portal_url')
+                       ctool = getToolByName(self, 'portal_catalog')
                        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
index bee4b4d380f2d5b4675f85063eeff5b876b7fbc2..30124693149980d3275aefff6b48500d434d121d 100755 (executable)
@@ -9,8 +9,6 @@
 # http://creativecommons.org/licenses/by-nc/2.0/           #
 ############################################################
 """ Deprecated Image and Portfolio classes
-$Id: Portfolio.py 622 2008-11-16 23:38:18Z pin $
-$URL: http://svn.luxia.fr/svn/labo/projects/zope/Portfolio/trunk/Portfolio.py $
 """
 
 from deprecated.Portfolio import Portfolio, Photo
index f179ddec630b53d688ee9f9105ca88e21eba439e..9b59eaada47d63b13df9192aa3ec134a82dfe574 100644 (file)
@@ -9,8 +9,6 @@
 # http://creativecommons.org/licenses/by-nc/2.0/           #
 ############################################################
 """ Image manipulation and presentation for CMF
-$Id: __init__.py 626 2008-11-22 09:11:58Z pin $
-$URL: http://svn.luxia.fr/svn/labo/projects/zope/Portfolio/trunk/__init__.py $
 """
 
 from Products.CMFCore import utils as cmfutils
index 1501cb5551dc072d5131fcc7dcdc846fc66809b6..11391aa9a1ff6a9131c5781a2a2f9f03953b8dd7 100755 (executable)
@@ -9,8 +9,6 @@
 # http://creativecommons.org/licenses/by-nc/2.0/           #
 ############################################################
 """ container classes for photo storage.
-$Id: container.py 622 2008-11-16 23:38:18Z pin $
-$URL: http://svn.luxia.fr/svn/labo/projects/zope/Portfolio/trunk/container.py $
 """
 
 from AccessControl import ClassSecurityInfo, Unauthorized
index dec74bcedcd6d58d4295e8bcd26f9c2635cad874..7e75286f28b6c5b455ec4941742cce158e672445 100755 (executable)
@@ -1,14 +1,14 @@
 # -*- coding: utf-8 -*-
-####################################################
-# Copyright © 2009 Luxia SAS. All rights reserved. #
-#                                                  #
-# Contributors:                                    #
-#  - Benoît Pin <pinbe@luxia.fr>                   #
-####################################################
+############################################################
+# Copyright © 2005-2010  Benoît PIN <benoit.pin@ensmp.fr>  #
+# Plinn - http://plinn.org                                 #
+#                                                          #
+# This program is free software; you can redistribute it   #
+# and/or modify it under the terms of the Creative Commons #
+# "Attribution-Noncommercial 2.0 Generic"                  #
+# http://creativecommons.org/licenses/by-nc/2.0/           #
+############################################################
 """ Event handlers module
-
-$Id: event_handlers.py 1391 2009-09-16 23:36:05Z pin $
-$URL: http://svn.luxia.fr/svn/labo/projects/zope/Portfolio/trunk/event_handlers.py $
 """
 
 import transaction
index 060540de9e61cca6dae23e935921dd2e9f8c3328..04f4281a491d623a2e841a967b34c7a9c8825cf7 100755 (executable)
@@ -1,14 +1,14 @@
 # -*- coding: utf-8 -*-
-####################################################
-# Copyright © 2009 Luxia SAS. All rights reserved. #
-#                                                  #
-# Contributors:                                    #
-#  - Benoît Pin <pinbe@luxia.fr>                   #
-####################################################
+############################################################
+# Copyright © 2005-2008  Benoît PIN <benoit.pin@ensmp.fr>  #
+# Plinn - http://plinn.org                                 #
+#                                                          #
+# This program is free software; you can redistribute it   #
+# and/or modify it under the terms of the Creative Commons #
+# "Attribution-Noncommercial 2.0 Generic"                  #
+# http://creativecommons.org/licenses/by-nc/2.0/           #
+############################################################
 """ Interfaces for Portfolio classes
-
-$Id: interfaces.py 1202 2009-07-15 08:48:42Z pin $
-$URL: http://svn.luxia.fr/svn/labo/projects/zope/Portfolio/trunk/interfaces.py $
 """
 
 from zope.interface import Interface
index 962d913eeba19f8eb1df8cc457aaadb13ebe65f1..98adde2170c2d82d1005dcfe3c5b88fc9e9092fa 100755 (executable)
@@ -10,8 +10,6 @@
 ############################################################
 """ Lightboxes contains references to images.
     References are made with CMFUid stuff.
-$Id: lightbox.py 622 2008-11-16 23:38:18Z pin $
-$URL: http://svn.luxia.fr/svn/labo/projects/zope/Portfolio/trunk/lightbox.py $
 """
 
 from Globals import InitializeClass
index 8c057d6312ee393c03865f0cb6526cdf26233291..a4623bad5f8df9306bd778a9eaf9625be1a54d00 100755 (executable)
@@ -1,21 +1,20 @@
 # -*- coding: utf-8 -*-
-####################################################
-# Copyright © 2009 Luxia SAS. All rights reserved. #
-#                                                  #
-# Contributors:                                    #
-#  - Benoît Pin <pinbe@luxia.fr>                   #
-####################################################
+############################################################
+# Copyright © 2005-2010  Benoît PIN <benoit.pin@ensmp.fr>  #
+# Plinn - http://plinn.org                                 #
+#                                                          #
+# This program is free software; you can redistribute it   #
+# and/or modify it under the terms of the Creative Commons #
+# "Attribution-Noncommercial 2.0 Generic"                  #
+# http://creativecommons.org/licenses/by-nc/2.0/           #
+############################################################
 """ Image threaded batch computation module
-
-$Id: manipulation.py 1391 2009-09-16 23:36:05Z pin $
-$URL: http://svn.luxia.fr/svn/labo/projects/zope/Portfolio/trunk/manipulation.py $
 """
 
 import threading
 import logging
 import atexit
 from types import StringTypes
-#import Zope2
 from math import ceil
 import transaction
 from ZODB.POSException import ConflictError
@@ -38,23 +37,6 @@ class ImageQueueProcessorThread(threading.Thread) :
                        itemsPath = [itemsPath]
                for i in itemsPath :
                        self.queueAdd(i)
-
-#      def __init__(self, portal_path, itemPath):
-#              threading.Thread.__init__(self)
-#              self.app = app = Zope2.app()
-#              self.portal = portal = app.unrestrictedTraverse(portal_path)
-#              self.imgTool = portal.portal_image_manipulation
-#              self.queue = []
-#              if itemPath :
-#                      self.queueAdd(itemPath)
-#              else :
-#                      ctool = portal.portal_catalog
-#                      brains = ctool.unrestrictedSearchResults(portal_type='Photo', tiles_available=0)
-#                      for b in brains :
-#                              self.queueAdd(b.getPath())
-       
-       def __del__(self) :
-               print "ayé, c'est la fin !"
        
        @property
        def queueSize(self) :
@@ -84,12 +66,7 @@ class ImageQueueProcessorThread(threading.Thread) :
                self.__stopped = True
        
        def _process(self, app) :
-               
                path = self.queue.pop(0)
-               
-               #import Zope2
-               #app = Zope2.app()
-               
                try :
                        p = app.unrestrictedTraverse(path)
                except KeyError :
index 2508ebcab4a4cd878fd754aae6a9734a828adf6c..e7a10a1daed02e07ad25f9f04d53e7a3fced4cbf 100755 (executable)
--- a/photo.py
+++ b/photo.py
@@ -9,8 +9,6 @@
 # http://creativecommons.org/licenses/by-nc/2.0/           #
 ############################################################
 """ CMFAware Image
-$Id: photo.py 1202 2009-07-15 08:48:42Z pin $
-$URL: http://svn.luxia.fr/svn/labo/projects/zope/Portfolio/trunk/photo.py $
 """
 
 from Globals import InitializeClass
index 1fee07f4843fcdc065e90a2b5e5bf24fc24b3e3a..4ee55201ccec07e16e4656d9564f63224a034e20 100755 (executable)
--- a/utils.py
+++ b/utils.py
@@ -9,8 +9,6 @@
 # http://creativecommons.org/licenses/by-nc/2.0/           #
 ############################################################
 """ Global utilities for portfolio / photo objects.
-$Id: utils.py 1200 2009-07-08 15:50:15Z pin $
-$URL: http://svn.luxia.fr/svn/labo/projects/zope/Portfolio/trunk/utils.py $
 """
 
 from AccessControl import ModuleSecurityInfo