| 674 | return result |
| 675 | |
| 676 | def ProcessFiles(self, files): |
| 677 | success = True |
| 678 | violations = 0 |
| 679 | for file in files: |
| 680 | try: |
| 681 | handle = open(file, "rb") |
| 682 | contents = decode(handle.read(), "ISO-8859-1") |
| 683 | if len(contents) > 0 and not self.ProcessContents(file, contents): |
| 684 | success = False |
| 685 | violations += 1 |
| 686 | finally: |
| 687 | handle.close() |
| 688 | print("Total violating files: %s" % violations) |
| 689 | return success |
| 690 | |
| 691 | def _CheckStatusFileForDuplicateKeys(filepath): |
| 692 | comma_space_bracket = re.compile(", *]") |