On Fri, Oct 23, 2009 at 12:01 AM, molicule <molic
...@gmail.com> wrote:
> I think a rake-like approach may work. In rake functions are used to
> build
> tasks as opposed to tasks being functions forcing tasks they generate
> to become
> sub tasks. So one way to do it in doit could be to build instances of
> a
> Task class within a dodo file as opposed to doit introspecting
> task_foo functions
> as tasks.
My point was you need a bunch of separate tasks, doesnt matter if they are
sub-tasks or not. Or how you create it. Each sub-task is actually an
independent
task. "sub-task" is only meta-information from how it was defined. I
don't get what
is really bothering you from sub-tasks...
doit supports a task with as many actions as you wish. thats another
option instead of
creating many sub-tasks. but they will always be executed together.
I don't know what is rake-like approach... I guess you mean that a
function is the task itself
(or the task-action itself).
In doit task_xxx() => this function is a "task generator" task are
build from the dictionaries
a task generators returns. In case a task generator defines more than
one task doit creates
a "group task" ( that is a task with no action that depends on all
its sub-tasks), and a bunch
of sub-tasks from the returned dictionaries.
doit design is that a task should be declarative it has actions, dependencies,
targets, ... but you use python to create it. It wouldnt be hard to make doit
read tasks from a text (or XML) file instead of reading it from a dodo file.
the dodo file is just used to generate tasks.
Do you want that a task generator returns many tasks but the tasks are
not sub-tasks?
If this is what you want it wont be hard :) As of today a task
generator can return a dictionary
or a python-generator. It doesnt accept lists. So we could say that a
task generator could also
return a list of dictionaries, where every dictionary will describe a
different task without associating
them as a sub-task.
> I think allowing people to write their own reporter plugins is a
> good idea this way even in dodo.py debug output could be
> seamlessly integrated with doit command output.
> I will look into the code to see about writing a new reporter.
cool. I am also interested in a less verbose reporter. I will probably
include yours
on the distribution code ;)
Regards,
Eduardo