From 1ca8a7a5b4e7e93234c558bc340d52b1020e1934 Mon Sep 17 00:00:00 2001 From: James Clarke Date: Wed, 10 Nov 2010 08:11:22 -0500 Subject: [PATCH] Fixed ability to turn off caching (cherry picked from commit e66164b2ca1575a33d1203fed7d6052e69dc46cb) --- lastfm/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lastfm/api.py b/lastfm/api.py index 1e8158e..cf47850 100644 --- a/lastfm/api.py +++ b/lastfm/api.py @@ -65,7 +65,6 @@ def __init__(self, self._api_key = api_key self._secret = secret self._session_key = session_key - self._cache = FileCache() self._urllib = urllib2 self._cache_timeout = Api.DEFAULT_CACHE_TIMEOUT self._initialize_request_headers(request_headers) @@ -74,6 +73,10 @@ def __init__(self, self._no_cache = no_cache self._logfile = logfile self._last_fetch_time = datetime.now() + if self._no_cache: + self._cache = None + else: + self._cache = FileCache() if debug is not None: if debug in Api.DEBUG_LEVELS: