X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=CacheHandler.py;h=42070a332f389182f1df6340c9602d98d3e59088;hb=591b42e1371c3887b56e0bd2c55a7bca663208fe;hp=cc5c87be16c70673cdb9428cf35bd0743a59eb9a;hpb=783caef083f5dcafaed71dfa3f3a8035109717e9;p=planet-ucc.git diff --git a/CacheHandler.py b/CacheHandler.py index cc5c87b..42070a3 100644 --- a/CacheHandler.py +++ b/CacheHandler.py @@ -18,7 +18,8 @@ class CacheHandler: try: cPickle.dump(blog, open(os.path.join('cache', name), 'w')) except: - sys.stderr.write('DEBUG: CacheHandler: Item could not be written to cache\n') +# sys.stderr.write('DEBUG: CacheHandler: Item could not be written to cache\n') + pass def getBlog(self, title, feed): name = self.__create_name__(title, feed) @@ -27,7 +28,7 @@ class CacheHandler: blog = cPickle.load(open(os.path.join('cache', name))) except: blog = None - sys.stderr.write('DEBUG: CacheHandler: Could not read item from cache\n') +# sys.stderr.write('DEBUG: CacheHandler: Could not read item from cache\n') return blog class CacheObject: @@ -35,3 +36,5 @@ class CacheObject: def __init__(self): self.etag = None self.date = None + def __ne__(self, other): + return self.etag != other.etag or self.date != other.date