From d30098d6468e62c87268e61fa828dfb62ac083df Mon Sep 17 00:00:00 2001 From: niphlod Date: Wed, 23 Oct 2013 00:03:04 +0200 Subject: [PATCH] inject W2P_TASK in current, so you can use current.W2P_TASK in imported modules. Thanks @Xiaonuo for the feature request --- gluon/scheduler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gluon/scheduler.py b/gluon/scheduler.py index 70c666db..957d9836 100644 --- a/gluon/scheduler.py +++ b/gluon/scheduler.py @@ -229,6 +229,9 @@ def executor(queue, task, out): "name '%s' not found in scheduler's environment" % f) #Inject W2P_TASK into environment _env.update({'W2P_TASK' : W2P_TASK}) + #Inject W2P_TASK into current + from gluon import current + current.W2P_TASK = W2P_TASK globals().update(_env) args = loads(task.args) vars = loads(task.vars, object_hook=_decode_dict)