fixed problem with recent cache commit

This commit is contained in:
mdipierro
2012-07-17 10:35:45 -05:00
parent 24e85b0da0
commit ac75bbdc9c
3 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.00.0 (2012-07-16 22:48:56) dev
Version 2.00.0 (2012-07-17 10:35:39) dev
+5 -7
View File
@@ -381,6 +381,8 @@ class CacheOnDisk(CacheAbstract):
class CacheAction(object):
def __init__(self,func,key,time_expire,cache,cache_model):
self.__name__ = func.__name__
self.__doc__ = func.__doc__
self.func = func
self.key = key
self.time_expire = time_expire
@@ -388,9 +390,9 @@ class CacheAction(object):
self.cache_model = cache_model
def __call__(self,*a,**b):
if not self.key:
key2 = self.func.__name__+':'+repr(a)+':'+repr(b)
key2 = self.__name__+':'+repr(a)+':'+repr(b)
else:
key2 = self.key.replace('%(name)s',self.func.__name__)\
key2 = self.key.replace('%(name)s',self.__name__)\
.replace('%(args)s',str(a)).replace('%(vars)s',str(b))
cache_model = self.cache_model
if not cache_model or isinstance(cache_model,str):
@@ -473,11 +475,7 @@ class Cache(object):
"""
def tmp(func,cache=self,cache_model=cache_model):
action = CacheAction(func,key,time_expire,self,cache_model)
action.__name___ = func.__name__
action.__doc__ = func.__doc__
return action
return CacheAction(func,key,time_expire,self,cache_model)
return tmp
def lazy_lazy_cache(key=None,time_expire=None,cache_model='ram'):
+2
View File
@@ -2170,6 +2170,8 @@ class PostgreSQLAdapter(BaseAdapter):
return varquote_aux(name,'"%s"')
def adapt(self,obj):
#if self.driver == self.drivers.get('pg8000'):
# obj = str(obj).replace('%','%%')
return psycopg2_adapt(obj).getquoted()
def sequence_name(self,table):