[Ml-yokadi] Using '_' as a shortcut to last task id

Sébastien Renard Sebastien.Renard at digitalfox.org
Fri Sep 25 08:57:40 CEST 2009


Le jeudi 17 septembre 2009 09:26:09, Aurélien Gâteau a écrit :
> > Well, after reading your patch I have a concern about the global variable
> > lastTaskId. As this information is tightly related to shell context, why
> > don't simply add it as a YokadiCmd member ?
>
> If I do this, then how would dbutils.getTaskFromId() reach it? I am
> afraid moving it would mean changing every task command to explicitly
> pass the lastTaskId.

Indeed, it is the only clean way to do it. But that's not a huge work. I give 
it a try in "without_glob" branch.

git diff --stat give that : 
 src/yokadi/dbutils.py               |   19 +++++--------------
 src/yokadi/taskcmd.py               |   31 +++++++++++++++++++++----------
 src/yokadi/tests/dbutilstestcase.py |    5 ++---
 src/yokadi/yokadi.py                |    1 +
 4 files changed, 29 insertions(+), 27 deletions(-)

It simplify dbutils and make it more generic, but the API from taskcmd is 
slightly more complicated (and less magic btw).


a+
-- 
Sébastien


More information about the Ml-yokadi mailing list