Commit effb4996 authored by Vincent Pelletier's avatar Vincent Pelletier

Remove unused definitions of CachingMethod.

Also, update warning message.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37182 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7b59861b
...@@ -84,20 +84,11 @@ except ImportError: ...@@ -84,20 +84,11 @@ except ImportError:
try: try:
from Products.ERP5Type.Cache import enableReadOnlyTransactionCache, \ from Products.ERP5Type.Cache import enableReadOnlyTransactionCache, \
disableReadOnlyTransactionCache, CachingMethod, \ disableReadOnlyTransactionCache, caching_instance_method
caching_instance_method
except ImportError: except ImportError:
LOG('SQLCatalog', WARNING, 'Count not import CachingMethod, expect slowness.') LOG('SQLCatalog', WARNING, 'Count not import caching_instance_method, expect slowness.')
def doNothing(context): def doNothing(context):
pass pass
class CachingMethod:
"""
Dummy CachingMethod class.
"""
def __init__(self, callable, **kw):
self.function = callable
def __call__(self, *opts, **kw):
return self.function(*opts, **kw)
def caching_instance_method(*args, **kw): def caching_instance_method(*args, **kw):
return lambda method: method return lambda method: method
enableReadOnlyTransactionCache = doNothing enableReadOnlyTransactionCache = doNothing
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment