Consider the following dodo.py
file:
from doit.tools import title_with_actions
DOIT_CONFIG = {'default_tasks': ['mytask']}
def task_mytask():
return {
# 'name': 'mysubtask',
'params': [{
'name': 'myparam',
'short': 'p',
'long': 'myparam',
'default': 'param_default',
}],
'actions': ["echo myparam is %(myparam)s"],
'title': title_with_actions,
'verbosity': 2,
}
Executing it yields:
>>> doit
. mytask => Cmd: echo myparam is %(myparam)s
myparam is param_default
You can notice that the title created for the action is not correct: one would expect to see
Cmd: echo myparam is param_default
, in other words one would expect that this title, since it is created after task instantiation, actually represents what will be executed.
I see two ways to fix this:
title_with_actions
method. This would force us to write an ugly if/elif statement in it to support all kind of BaseAction
subtypes.__str__
in all BaseAction
subtypes directly. For example for CmdAction
: def __str__(self):
# try to replace all options in the various commands
try:
_action = self.expand_action()
except Exception:
_action = self._action
return "Cmd: %s" % _action
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too