Custom reporter disabled by -r executed-only command-line option

14 views
Skip to first unread message

Tom Varga

unread,
Dec 15, 2014, 5:21:55 PM12/15/14
to pytho...@googlegroups.com

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

Eduardo Schettino

unread,
Dec 19, 2014, 9:22:12 PM12/19/14
to python-doit
The "-r" means "--reporter"... Command line options have precendece over options set on dodo.py.
That's why your custom reporter is being ignored.

cheers,
  Eduardo
Reply all
Reply to author
Forward
0 new messages