summaryrefslogtreecommitdiffstats
path: root/funcweb
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-07-20 22:34:39 +0300
committermakkalot <makkalot@gmail.com>2008-07-20 22:34:39 +0300
commitd8e283abc8d8382cebf08f56127cd958bcf71407 (patch)
tree31ffd704deb75c863e3259504142829b87177e24 /funcweb
parentee28acfac71b5132fbdca9fb85fcce099cbafce2 (diff)
downloadfunc-d8e283abc8d8382cebf08f56127cd958bcf71407.tar.gz
func-d8e283abc8d8382cebf08f56127cd958bcf71407.tar.xz
func-d8e283abc8d8382cebf08f56127cd958bcf71407.zip
some fixes in select from method
Diffstat (limited to 'funcweb')
-rw-r--r--funcweb/funcweb/async_tools.py27
1 files changed, 20 insertions, 7 deletions
diff --git a/funcweb/funcweb/async_tools.py b/funcweb/funcweb/async_tools.py
index aa28961..1d6e4ce 100644
--- a/funcweb/funcweb/async_tools.py
+++ b/funcweb/funcweb/async_tools.py
@@ -111,10 +111,10 @@ class AsyncResultManager(object):
status = None
#get the list of the finished jobs
if pull_property == self.pull_property_options[0]:
- code = (JOB_ID_FINISHED,)
+ code = JOB_ID_FINISHED
#get the jobs that caused error
elif pull_property == self.pull_property_options[1]:
- code = (JOB_ID_LOST_IN_SPACE,JOB_ID_REMOTE_ERROR)
+ code = JOB_ID_REMOTE_ERROR
#get the jobs which are new
elif pull_property == self.pull_property_options[2]:
status = self.JOB_CODE_NEW
@@ -132,12 +132,18 @@ class AsyncResultManager(object):
return None
#now pull the list and return it back
final_list = []
-
+ #print "The current list in the selct is :",self.__current_list
for job_id,code_status_pack in self.__current_list.iteritems():
- if code and code == code_status_pack[0]:
- final_list.append(dict(job_id=code_status_pack))
- elif status and code_status_pack[1] == status:
- final_list.append(dict(job_id=code_status_pack))
+ if code != None and code == code_status_pack[0]:
+ tmp_hash = {}
+ tmp_hash[job_id]=code_status_pack
+
+ #print "To select %s with code %s"%(job_id,code)
+ final_list.append(tmp_hash)
+ elif status != None and code_status_pack[1] == status:
+ tmp_hash = {}
+ tmp_hash[job_id]=code_status_pack
+ final_list.append(tmp_hash)
#get the final list here
return final_list
@@ -167,6 +173,13 @@ class AsyncResultManager(object):
"Reset the list may need it sometimes :)"
self.__current_list = {}
+
+ def refresh_list(self):
+ """
+ Simple one to checkout to prepopulate the current memory list
+ """
+ self.__get_current_list()
+
if __name__ == "__main__":
pass