@@ -259,15 +259,12 @@ def __init__(self, cache_dir, **options):
259
259
raise ValueError ("Must have read/write access to {} for local file caching." .format (self .cache_dir ))
260
260
261
261
def cache_has (self , cache_key ):
262
- print "file has" ,cache_key
263
262
return os .path .exists (self .cache_path (cache_key ))
264
263
265
264
def cache_get (self , cache_key , ** options ):
266
- print "file get" ,cache_key
267
265
return self .load_local_resource_contents (self .cache_path (cache_key ),** options )
268
266
269
267
def cache_set (self , cache_key , value ):
270
- print "file set" ,cache_key
271
268
cache_path = self .cache_path (cache_key )
272
269
bucket_dir = os .path .dirname (cache_path )
273
270
if not os .path .exists (bucket_dir ):
@@ -287,22 +284,18 @@ def __init__(self, cache_max_size=0, **options):
287
284
self .cache_max_size = cache_max_size
288
285
289
286
def cache_set (self , cache_key , value ):
290
- print "dict set" ,cache_key
291
287
if self .cache_max_size and len (self .cache_dict ) >= self .cache_max_size :
292
288
oldest_cache_key = min (self .cache_used .items (), key = lambda e : e [1 ])[0 ]
293
- print "dict del" , oldest_cache_key
294
289
del self .cache_used [oldest_cache_key ]
295
290
del self .cache_dict [oldest_cache_key ]
296
291
self .cache_dict [cache_key ] = value
297
292
self .cache_used [cache_key ] = time .time ()
298
293
299
294
def cache_get (self , cache_key ):
300
- print "dict get" ,cache_key
301
295
self .cache_used [cache_key ] = time .time ()
302
296
return self .cache_dict [cache_key ]
303
297
304
298
def cache_has (self , cache_key ):
305
- print "dict has" ,cache_key
306
299
return cache_key in self .cache_dict
307
300
308
301
class DoubleCachedSC2Factory (DictCachedSC2Factory , FileCachedSC2Factory ):
0 commit comments