The branch, master has been updated
via 52a41610c7a33534b485fad57038caf731a7256c (commit)
via e93ddd67fa55870260bf2bfe1c45eb5f46b9b771 (commit)
from d19571307fd6f20f1a9e908990050aa05d4cabdb (commit)
- Log -----------------------------------------------------------------
commit 52a41610c7a33534b485fad57038caf731a7256c
Author: Michal Čihař <michal(a)cihar.com>
Date: Sun Dec 26 09:06:13 2010 +0100
Do no try to cache parsed XML
It seems to fail for some reason, and parsing it is not really
expensive.
commit e93ddd67fa55870260bf2bfe1c45eb5f46b9b771
Author: Michal Čihař <michal(a)cihar.com>
Date: Sun Dec 26 09:05:11 2010 +0100
Catch another type of corrupt cache file.
-----------------------------------------------------------------------
Summary of changes:
helper/cache.py | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/helper/cache.py b/helper/cache.py
index c7dc626..0aa9824 100644
--- a/helper/cache.py
+++ b/helper/cache.py
@@ -86,7 +86,7 @@ class Cache(object):
self.dbg('Using cache for %s!' % name)
try:
return cPickle.load(open(filename, 'r'))
- except TypeError:
+ except (TypeError, EOFError):
# Cache can not be unpickled
self.warn('Deleting cache for %s!' % name)
os.unlink(filename)
@@ -143,14 +143,8 @@ class XMLCache(URLCache):
def load(self, name, url):
self.dbg('Downloading and parsing %s feed...' % name)
self.dbg('URL: %s' % url)
- cache = 'feed-%s' % name
- try:
- result = self.get(cache)
- except NoCache:
- data = super(XMLCache, self).load(url)
- result = minidom.parseString(data.strip())
- self.set(cache, result)
- return result
+ data = super(XMLCache, self).load(url)
+ return minidom.parseString(data.strip())
class FeedCache(URLCache):
'''
hooks/post-receive
--
phpMyAdmin website