aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility
diff options
context:
space:
mode:
authorZachary Sloan2013-04-18 22:36:39 +0000
committerZachary Sloan2013-04-18 22:36:39 +0000
commit5ffd0debd5ab7ee0e98def74374a8e996629f5c9 (patch)
tree74fd7f83e9d94d49f6e77a009f5d39e6081aa019 /wqflask/utility
parentf36de42faa6565a04c344071a3a4befa60879509 (diff)
downloadgenenetwork2-5ffd0debd5ab7ee0e98def74374a8e996629f5c9.tar.gz
The plink_input is split into chunks that are stored in temp_data, but
we might decide to store it differently
Diffstat (limited to 'wqflask/utility')
-rw-r--r--wqflask/utility/temp_data.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/wqflask/utility/temp_data.py b/wqflask/utility/temp_data.py
index ddf2653c..60f01167 100644
--- a/wqflask/utility/temp_data.py
+++ b/wqflask/utility/temp_data.py
@@ -1,14 +1,15 @@
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, part=None):
+
+ def __init__(self, temp_uuid, preface="tempdata", part=None):
self.temp_uuid = temp_uuid
self.redis = Redis()
- self.key = "tempdata:{}".format(self.temp_uuid)
+ self.key = "{}:{}".format(preface, self.temp_uuid)
if part:
self.key += ":{}".format(part)
@@ -19,9 +20,12 @@ class TempData(object):
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("{}.{}={}".format(key, field, redis.hget(key, field)))
+ print(" {}.{}={}\n".format(key, field, len(redis.hget(key, field))))