From b14b0bd922e6ebf247d8ead6e8a27bc9730b02a6 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Beno=C3=AEt=20Pin?= <benoit.pin@gmail.com>
Date: Tue, 26 Oct 2010 00:06:20 +0200
Subject: [PATCH 1/1] =?utf8?q?Compatibilit=C3=A9=20minimum=20pour=20que=20?=
 =?utf8?q?zope=20se=20lance.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

---
 Portfolio.py |  3 ++-
 photo.py     | 10 ++++++----
 utils.py     |  6 ++++--
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/Portfolio.py b/Portfolio.py
index 3012469..beb1f75 100755
--- a/Portfolio.py
+++ b/Portfolio.py
@@ -11,4 +11,5 @@
 """ Deprecated Image and Portfolio classes
 """
 
-from deprecated.Portfolio import Portfolio, Photo
+# TODO: se décider à le virer pour de bon !
+# from deprecated.Portfolio import Portfolio, Photo
diff --git a/photo.py b/photo.py
index e7a10a1..a90ef42 100755
--- a/photo.py
+++ b/photo.py
@@ -21,9 +21,11 @@ from Products.CMFCore.permissions import View, AccessContentsInformation, \
 from permissions import ViewRawImage
 from zope.component.factory import Factory
 from zope.interface import implements
-from webdav.WriteLockInterface import WriteLockInterface as z2IWriteLock
+#from webdav.WriteLockInterface import WriteLockInterface as z2IWriteLock
+from webdav.interfaces import IWriteLock
 from Products.CMFCore.interfaces import IContentish
-from Products.CMFCore.interfaces.Contentish import Contentish as z2IContentish
+from Products.CMFCore.interfaces import IDynamicType
+#from Products.CMFCore.interfaces.Contentish import Contentish as z2IContentish
 
 from Products.CMFCore.DynamicType import DynamicType
 from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
@@ -37,8 +39,8 @@ from interfaces import IPhoto
 class Photo(DynamicType, CMFCatalogAware, BasePhoto, DefaultDublinCoreImpl) :
 	""" Photo CMF aware """
 	
-	implements(IPhoto, IContentish)
-	__implements__ = (z2IContentish, z2IWriteLock, DynamicType.__implements__)
+	implements(IPhoto, IContentish, IWriteLock, IDynamicType)
+	#__implements__ = (z2IContentish, IWriteLock, DynamicType.__implements__)
 	
 	meta_type = BasePhoto.meta_type
 	manage_options = BasePhoto.manage_options
diff --git a/utils.py b/utils.py
index 4ee5520..26ed830 100755
--- a/utils.py
+++ b/utils.py
@@ -12,7 +12,7 @@
 """
 
 from AccessControl import ModuleSecurityInfo
-from Products.PageTemplates.GlobalTranslationService import getGlobalTranslationService
+#from Products.PageTemplates.GlobalTranslationService import getGlobalTranslationService
 from zope.i18nmessageid import MessageFactory
 
 security = ModuleSecurityInfo('Products.Portfolio.utils')
@@ -24,10 +24,12 @@ security.declarePublic('translate')
 def translate(message, context):
 	""" Translate i18n message.
 	"""
-	GTS = getGlobalTranslationService()
+	# TODO: touver une solution.
+	# GTS = getGlobalTranslationService()
 	if isinstance(message, Exception):
 		try:
 			message = message[0]
 		except (TypeError, IndexError):
 			pass
+	return message
 	return GTS.translate('portfolio', message, context=context)
-- 
2.20.1