| OLD | NEW |
| 1 #! /usr/bin/python | 1 #! /usr/bin/python |
| 2 # | 2 # |
| 3 # Protocol Buffers - Google's data interchange format | 3 # Protocol Buffers - Google's data interchange format |
| 4 # Copyright 2015 Google Inc. All rights reserved. | 4 # Copyright 2015 Google Inc. All rights reserved. |
| 5 # https://developers.google.com/protocol-buffers/ | 5 # https://developers.google.com/protocol-buffers/ |
| 6 # | 6 # |
| 7 # Redistribution and use in source and binary forms, with or without | 7 # Redistribution and use in source and binary forms, with or without |
| 8 # modification, are permitted provided that the following conditions are | 8 # modification, are permitted provided that the following conditions are |
| 9 # met: | 9 # met: |
| 10 # | 10 # |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 return self._original_content | 618 return self._original_content |
| 619 | 619 |
| 620 @property | 620 @property |
| 621 def processed_content(self): | 621 def processed_content(self): |
| 622 return self._processed_content | 622 return self._processed_content |
| 623 | 623 |
| 624 | 624 |
| 625 def main(args): | 625 def main(args): |
| 626 usage = '%prog [OPTIONS] PATH ...' | 626 usage = '%prog [OPTIONS] PATH ...' |
| 627 description = ( | 627 description = ( |
| 628 'Processes PDDM directives in the the given paths and write them back' | 628 'Processes PDDM directives in the given paths and write them back out.' |
| 629 ' out.' | |
| 630 ) | 629 ) |
| 631 parser = optparse.OptionParser(usage=usage, description=description) | 630 parser = optparse.OptionParser(usage=usage, description=description) |
| 632 parser.add_option('--dry-run', | 631 parser.add_option('--dry-run', |
| 633 default=False, action='store_true', | 632 default=False, action='store_true', |
| 634 help='Don\'t write back to the file(s), just report if the' | 633 help='Don\'t write back to the file(s), just report if the' |
| 635 ' contents needs an update and exit with a value of 1.') | 634 ' contents needs an update and exit with a value of 1.') |
| 636 parser.add_option('--verbose', | 635 parser.add_option('--verbose', |
| 637 default=False, action='store_true', | 636 default=False, action='store_true', |
| 638 help='Reports is a file is already current.') | 637 help='Reports is a file is already current.') |
| 639 parser.add_option('--collapse', | 638 parser.add_option('--collapse', |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 print 'Update needed for "%s".' % a_path | 677 print 'Update needed for "%s".' % a_path |
| 679 result = 1 | 678 result = 1 |
| 680 elif opts.verbose: | 679 elif opts.verbose: |
| 681 print 'No update for "%s".' % a_path | 680 print 'No update for "%s".' % a_path |
| 682 | 681 |
| 683 return result | 682 return result |
| 684 | 683 |
| 685 | 684 |
| 686 if __name__ == '__main__': | 685 if __name__ == '__main__': |
| 687 sys.exit(main(sys.argv[1:])) | 686 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |