Accessing list of tasks programatically

19 views
Skip to first unread message

Thibaut Lamadon

unread,
Jun 23, 2020, 10:14:47 AM6/23/20
to python-doit
Hi all, 

I would like to write my own "status" command. I see the section on extending pydoit here: 

But I can't find documentation on what I can get access to from there. Is there a way to get the list of tasks?

I guess I could start from replicating class List(DoitCmdBase). But seems like an overkill, 

thank you!

Eduardo Schettino

unread,
Jun 23, 2020, 10:23:44 AM6/23/20
to python-doit
On Tue, Jun 23, 2020 at 10:14 PM Thibaut Lamadon <thibaut...@gmail.com> wrote:

But I can't find documentation on what I can get access to from there. Is there a way to get the list of tasks?

There is no documentation for it. You will need to read the source code, there are lots of docstrings but might be challenging to navigate.
 

I guess I could start from replicating class List(DoitCmdBase). But seems like an overkill, 

Yes, the best option is to start from an existing command.

You did not explain what your "status" command would do...
I suggest you take a look at the "info" command as might do what you are looking for.
Or look at the "ignore" command that is very simple and easier to get started with.

If you have questions about internals feel free to ask.
And also to contribute an "internals" guide documentation :)

Cheers

Thibaut Lamadon

unread,
Jun 23, 2020, 10:53:41 AM6/23/20
to python-doit
Great, I just took a look at Ignore and indeed it is quite informative! 

I am not sure yet the way I want the status command to work, but I find it sometimes difficult to get a full status of the current state of the build chain. I think I would simply want the list of tasks, with the list of dependencies and targets, and the uptodate status. It might be possible already :-), but I might want to export this to a json or something. So I will continue looking at the code!

I have also been working on an executor for an HPC, but for now I am using an external wrapped script (which works fine). I would want to build on top of dask (which I use in other cases), but more on this later!

Thanks for your help, 
Reply all
Reply to author
Forward
0 new messages