I've been trying to create a custom reporter and ran into a problem because I also want to specify the -r executed-only command-line option.
From the document, I have the following in the dodo.py file:
from doit.reporter import ConsoleReporter
class MyReporter(ConsoleReporter):
def execute_task(self, task):
self.outstream.write('MyReporter --> %s\n' % task.title())
DOIT_CONFIG['reporter'] = MyReporter
def task_sample3():
for x in range(3):
yield {'name' : str(x),
'actions': ['echo out %d' % x]}
> doit sample3
MyReporter --> sample3:0
out 0
MyReporter --> sample3:1
out 1
MyReporter --> sample3:2
out 2
MyReporter --> sample3
> doit -r executed-only sample3
. sample3:0
out 0
. sample3:1
out 1
. sample3:2
out 2
I really want to limit console output to only executed tasks. However, I do want to use a custom reporter.
Is the above behavior a bug? Or, is there another way to specify use of a custom reporter but only for executed tasks?
Thanks in advance for any suggestions.
-Tom