diff options
author | Pjotr Prins | 2015-04-19 12:05:38 +0200 |
---|---|---|
committer | Pjotr Prins | 2015-04-19 12:05:38 +0200 |
commit | e3adbf898dd537688339c8af1b59ac440aef3848 (patch) | |
tree | 99d3b4bbc2fcac2490d159165673a341b6bde13f | |
parent | ac57e839c8ffb52f65e74a9064e4adeb15c76b49 (diff) | |
download | genenetwork2-e3adbf898dd537688339c8af1b59ac440aef3848.tar.gz |
pylmm: move temp_data local
-rw-r--r--[-rwxr-xr-x] | wqflask/wqflask/my_pylmm/pyLMM/benchmark.py | 0 | ||||
-rw-r--r-- | wqflask/wqflask/my_pylmm/pyLMM/lmm.py | 2 | ||||
-rw-r--r-- | wqflask/wqflask/my_pylmm/pyLMM/temp_data.py | 25 |
3 files changed, 26 insertions, 1 deletions
diff --git a/wqflask/wqflask/my_pylmm/pyLMM/benchmark.py b/wqflask/wqflask/my_pylmm/pyLMM/benchmark.py index 6c6c9f88..6c6c9f88 100755..100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/benchmark.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/benchmark.py diff --git a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py index 135ba1f4..2d9ca812 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py @@ -45,7 +45,7 @@ from benchmark import Bench import simplejson as json from redis import Redis Redis = Redis() -from utility import temp_data +import temp_data has_gn2=None diff --git a/wqflask/wqflask/my_pylmm/pyLMM/temp_data.py b/wqflask/wqflask/my_pylmm/pyLMM/temp_data.py new file mode 100644 index 00000000..004d45c6 --- /dev/null +++ b/wqflask/wqflask/my_pylmm/pyLMM/temp_data.py @@ -0,0 +1,25 @@ +from __future__ import print_function, division, absolute_import +from redis import Redis + +import simplejson as json + +class TempData(object): + + def __init__(self, temp_uuid): + self.temp_uuid = temp_uuid + self.redis = Redis() + 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*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(): + for field in redis.hkeys(key): + print("{}.{}={}".format(key, field, redis.hget(key, field))) |