]> git.decadent.org.uk Git - dak.git/blob - daklib/lintian.py
Add a docstring for parse_lintian_output
[dak.git] / daklib / lintian.py
1 from regexes import re_parse_lintian
2
3 def parse_lintian_output(output):
4     """
5     Parses Lintian output and returns a generator with the data.
6
7     >>> list(parse_lintian_output('W: pkgname: some-tag path/to/file'))
8     [('W', 'pkgname', 'some-tag', 'path/to/file')]
9     """
10
11     for line in output.split('\n'):
12         m = re_parse_lintian.match(line)
13         if m:
14             yield m.groups()