[Erp5-report] r27971 - in /erp5/trunk/products/ERP5: Document/ interfaces/
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Jul 6 13:51:55 CEST 2009
Author: nicolas
Date: Mon Jul 6 13:51:54 2009
New Revision: 27971
URL: http://svn.erp5.org?rev=27971&view=rev
Log:
Follow Interface specification
Modified:
erp5/trunk/products/ERP5/Document/Document.py
erp5/trunk/products/ERP5/interfaces/document.py
Modified: erp5/trunk/products/ERP5/Document/Document.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Document.py?rev=27971&r1=27970&r2=27971&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Document.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Document.py [utf8] Mon Jul 6 13:51:54 2009
@@ -63,12 +63,6 @@
items.sort()
return tuple(items)
-def generateCacheId(**kw):
- """Generate proper cache id based on **kw.
- Function inspired from ERP5Type.Cache
- """
- return str(makeSortedTuple(kw)).translate(string.maketrans('', ''), """[]()<>'", """)
-
class SnapshotMixin:
"""
This class provides a generic API to store in the ZODB
@@ -163,7 +157,7 @@
"""
"""
self.updateConversionCache()
- cache_id = generateCacheId(**kw)
+ cache_id = self.generateCacheId(**kw)
plugin_list = self._getCacheFactory().getCachePluginList()
#If there is no plugin list return False OR one them is doesn't contain
#cache_id for givent scope, return False
@@ -180,7 +174,7 @@
"""
"""
self.updateConversionCache()
- cache_id = generateCacheId(**kw)
+ cache_id = self.generateCacheId(**kw)
cache_factory = self._getCacheFactory()
cache_duration = cache_factory.cache_duration
if data is not None:
@@ -197,7 +191,7 @@
"""
"""
self.updateConversionCache()
- cache_id = generateCacheId(**kw)
+ cache_id = self.generateCacheId(**kw)
for cache_plugin in self._getCacheFactory().getCachePluginList():
cache_entry = cache_plugin.get(self.getPath(), DEFAULT_CACHE_SCOPE)
data = cache_entry.getValue().get(cache_id)
@@ -212,6 +206,12 @@
if self.hasConversion(**kw):
return len(self.getConversion(**kw))
return 0
+
+ def generateCacheId(self, **kw):
+ """Generate proper cache id based on **kw.
+ Function inspired from ERP5Type.Cache
+ """
+ return str(makeSortedTuple(kw)).translate(string.maketrans('', ''), """[]()<>'", """)
class PermanentURLMixIn(ExtensibleTraversableMixIn):
"""
@@ -1199,7 +1199,7 @@
# Base format support
security.declareProtected(Permissions.ModifyPortalContent, 'convertToBaseFormat')
- def convertToBaseFormat(self):
+ def convertToBaseFormat(self, **kw):
"""
Converts the content of the document to a base format
which is later used for all conversions. This method
Modified: erp5/trunk/products/ERP5/interfaces/document.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/interfaces/document.py?rev=27971&r1=27970&r2=27971&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/interfaces/document.py [utf8] (original)
+++ erp5/trunk/products/ERP5/interfaces/document.py [utf8] Mon Jul 6 13:51:54 2009
@@ -191,9 +191,9 @@
**kw can be various things - e.g. resolution
"""
- def generateCacheId(format):
+ def generateCacheId(**kw):
"""Return string to identify Document in cache pool with
- format - reference - version - language
+ all arguments used to convert the document
"""
def convertToBaseFormat(**kw):
More information about the Erp5-report
mailing list