[Erp5-report] r29737 - /erp5/trunk/products/ZSQLCatalog/SQLCatalog.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 16 11:41:53 CEST 2009


Author: kazuhiko
Date: Fri Oct 16 11:41:51 2009
New Revision: 29737

URL: http://svn.erp5.org?rev=29737&view=rev
Log:
caching_class_method_decorator is now defined in ERP5Type.Cache.

Modified:
    erp5/trunk/products/ZSQLCatalog/SQLCatalog.py

Modified: erp5/trunk/products/ZSQLCatalog/SQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/SQLCatalog.py?rev=29737&r1=29736&r2=29737&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/SQLCatalog.py [utf8] (original)
+++ erp5/trunk/products/ZSQLCatalog/SQLCatalog.py [utf8] Fri Oct 16 11:41:51 2009
@@ -69,8 +69,9 @@
   psyco = None
 
 try:
-  from Products.ERP5Type.Cache import enableReadOnlyTransactionCache
-  from Products.ERP5Type.Cache import disableReadOnlyTransactionCache, CachingMethod
+  from Products.ERP5Type.Cache import enableReadOnlyTransactionCache, \
+       disableReadOnlyTransactionCache, CachingMethod, \
+       caching_class_method_decorator
 except ImportError:
   LOG('SQLCatalog', WARNING, 'Count not import CachingMethod, expect slowness.')
   def doNothing(context):
@@ -83,17 +84,13 @@
       self.function = callable
     def __call__(self, *opts, **kw):
       return self.function(*opts, **kw)
+  class caching_class_method_decorator:
+    def __init__(self, *args, **kw):
+      pass
+    def __call__(self, method):
+      return method
   enableReadOnlyTransactionCache = doNothing
   disableReadOnlyTransactionCache = doNothing
-
-class caching_class_method_decorator:
-  def __init__(self, *args, **kw):
-    self.args = args
-    self.kw = kw
-
-  def __call__(self, method):
-    caching_method = CachingMethod(method, *self.args, **self.kw)
-    return lambda *args, **kw: caching_method(*args, **kw)
 
 try:
   from Products.ERP5Type.TransactionalVariable import getTransactionalVariable




More information about the Erp5-report mailing list