Hi,

I want to write a small script running pylint over a group of files and
collecting the output for each run in an individual string / file


I thought, that creating a TextReporter instance with output being set
to my stream handler should do the job.

I think I'm overlooking something.

Does anyone have an idea?

Complete code below:

#!/usr/bin/env python
from pylint import lint
from pylint.reporters.text import TextReporter
from cStringIO import StringIO

filenames = [ __file__ , 'anotherfile.py' ]

for filename in filenames:
    args = [ '-f',  "text", filename]
    my_output = StringIO()
    reporter = TextReporter(output=my_output)
    lint.Run(args, reporter=reporter, exit=False)
    output_str = my_output.getvalue()
    print "Got %d characters" % len(output_str)
    # do_something_with(output_str)

_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to