aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 06cbba68..b445051d 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -1154,19 +1154,31 @@ class Cache:
return cachename
class JCache:
- # Generates a single key from multiple values
+ dirname = os.path.join(Cache.dirname, 'jcache')
+
+ @staticmethod
+ def ensure():
+ Cache.ensure()
+ if not os.path.exists(JCache.dirname):
+ os.makedirs(JCache.dirname)
+
@staticmethod
- def get_key(keys):
- return ''
+ def get_shortkey(keys):
+ if type(keys) not in [list, tuple]:
+ keys = [keys]
+ ret = ''
+ for key in keys:
+ ret += md5.md5(key).hexdigest()
+ return ret
- # Returns a cached value for a key (from get_key), if it exists
+ # Returns a cached value, if it exists. Make sure the full key matches
@staticmethod
- def get(key):
+ def get(shortkey, keys):
return None
# Sets the cached value for a key (from get_key)
@staticmethod
- def set(key, value):
+ def set(shortkey, keys, value):
pass
# Compression of code and data for smaller downloads