Process a python file.
(self, path)
| 84 | self.cpp_src_map[str(path)] = errors |
| 85 | |
| 86 | def process_python(self, path): |
| 87 | """Process a python file.""" |
| 88 | (pylint_stdout, pylint_stderr) = epylint.py_run( |
| 89 | ' '.join([str(path)] + self.pylint_opts), return_std=True) |
| 90 | emap = {} |
| 91 | err = pylint_stderr.read() |
| 92 | if len(err): |
| 93 | print(err) |
| 94 | for line in pylint_stdout: |
| 95 | sys.stderr.write(line) |
| 96 | key = line.split(':')[-1].split('(')[0].strip() |
| 97 | if key not in self.pylint_cats: |
| 98 | continue |
| 99 | if key not in emap: |
| 100 | emap[key] = 1 |
| 101 | else: |
| 102 | emap[key] += 1 |
| 103 | self.python_map[str(path)] = emap |
| 104 | |
| 105 | def print_summary(self, strm): |
| 106 | """Print summary of lint.""" |