New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@task_param()
decorator to pass command line parameters to task generators and @create_after
for class defined tasks
#323
Conversation
Task parameters defined with 8/13: Absent any input I decided this is a feature. |
hmm... well, I've got a bug buried down there coping with @create_after tasks. I'll fix that soon. |
I believe this is ready to merge. I'm using this locally with my own doit-based automations and nikola. So far, so good. |
Hmmm.... I've found a wrinkle and I think I'd like input on what the best behavior would be: Given
Run:
The parameter definition was propagated to the subtask but not the value. The task Two options:
Option 2 seems "least surprising". Opinions? |
@schettino72 ^ just checking in to see if you had comments on the above. Thanks. |
@rbdixon sorry for very long delay. I should be able to merge this and release and next few weeks. |
I dont think it desirable to pass to subtasks. And since params is a simple dict it would be trivial to explicitly pass it into subtasks. But I think it should be part of base task. So it is documented by help command. |
Thanks for the comment. I'll work on this in January to:
|
@rbdixon could youp please rebase the PR to latest master? |
The @create_after decorator stashes a reference to the unbound method in a DelayedLoader instance. To work with tasks defined by methods the reference must be bound to the task creating class instance.
Add @task_param decorator to define parameters that will be available to the task generator and the tasks as well.
New branch rebased to master implementing only the #311. Still need to implement below as discussed in December:
|
I believe this final version satisfies all requests and comments and is ready to merge to master. |
@schettino72 Any further work required for this PR? |
sorry, i will have time only in march (hopefully) |
That’s OK... I understand. I appreciate your dedication to doit! |
Bump.... would love to see this merged. Thanks. |
I have merged this. I did some clean-up and fixes but still not complete.
|
As described in #311 this decorator can be used to pass command line arguments to the task generator. The same parameter definitions are also passed to the generated tasks.
This branch also includes pull request #307 which implements
@create_after()
semantics for tasks defined in a class. As discussed on #307 @schettino72 asked to see code for #311 as well. If this PR is merged then #307 will be closed.Quick implementation to see if this is what was intended by the issue and to open discussion.
Work to be done:
auto
compatibilityDemo: