aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/temp_data.py
diff options
context:
space:
mode:
authorZachary Sloan2013-04-23 21:37:55 +0000
committerZachary Sloan2013-04-23 21:37:55 +0000
commit8810c7735ed8a1bfa225449f7b388438e2ace890 (patch)
tree4b35d24664c463d2f63a209e8abeeced67311919 /wqflask/utility/temp_data.py
parent184c763c55e9399eefaa2fa2ad7e663e39acddaf (diff)
downloadgenenetwork2-8810c7735ed8a1bfa225449f7b388438e2ace890.tar.gz
Created file correlation_plot.py for the correlation scatterplot
Reverted temp_data.py to previous version that doesn't include the "part" input (for chunks) Made change to lmm related to splitting main iterator into chunks Deleted a bunch of unnecessary commented out code from show_trait.py
Diffstat (limited to 'wqflask/utility/temp_data.py')
-rw-r--r--wqflask/utility/temp_data.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/wqflask/utility/temp_data.py b/wqflask/utility/temp_data.py
index 60f01167..004d45c6 100644
--- a/wqflask/utility/temp_data.py
+++ b/wqflask/utility/temp_data.py
@@ -1,31 +1,25 @@
from __future__ import print_function, division, absolute_import
from redis import Redis
-import redis
import simplejson as json
class TempData(object):
-
- def __init__(self, temp_uuid, preface="tempdata", part=None):
+
+ def __init__(self, temp_uuid):
self.temp_uuid = temp_uuid
self.redis = Redis()
- self.key = "{}:{}".format(preface, self.temp_uuid)
- if part:
- self.key += ":{}".format(part)
+ self.key = "tempdata:{}".format(self.temp_uuid)
def store(self, field, value):
self.redis.hset(self.key, field, value)
- self.redis.expire(self.key, 60*60) # Expire in 60 minutes
+ self.redis.expire(self.key, 60*15) # Expire in 15 minutes
def get_all(self):
return self.redis.hgetall(self.key)
+
if __name__ == "__main__":
redis = Redis()
for key in redis.keys():
- print("key is:", key)
- if "plink" not in key:
- print(" Skipping...\n")
- continue
for field in redis.hkeys(key):
- print(" {}.{}={}\n".format(key, field, len(redis.hget(key, field))))
+ print("{}.{}={}".format(key, field, redis.hget(key, field)))