summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir@cohens.org.il>2017-11-25 18:34:47 +0200
committerTzafrir Cohen <tzafrir@cohens.org.il>2017-11-25 18:34:47 +0200
commit2afe16f6f74068eb8ab9430ddb117b0a1fdef980 (patch)
tree0cbd47fd96f193d498d317468fb98f7e5af8cdff
parentadb409da9df04e173e87c25429c9cec652a81ba5 (diff)
A dummy cache to disable caching when needed
-rw-r--r--default.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/default.py b/default.py
index 73aab17..5ea7394 100644
--- a/default.py
+++ b/default.py
@@ -26,7 +26,19 @@ KAN_URL = 'http://www.kan.org.il'
USER_AGENT = 'Kodi/plugin.video.kan/1.0' # I'm optimistic
PLUGIN_NAME = "plugin.video.kan" # FIXME: a better way to get this?
+class DummyCache:
+ def __init__(self):
+ pass
+
+ def get(self, cache_id, checksum=''):
+ return None
+
+ def set(self, cache_id, data, checksum='', expiration=None):
+ pass
+
+
SiteCache = simplecache.SimpleCache() # FIXME: avoid this global
+#SiteCache = DummyCache() # Avoid caching for now
def trace(msg):
xbmc.log(msg="Tzafrir: " + msg, level=xbmc.LOGNOTICE)