| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 import json | 7 import json |
| 8 import io | 8 import io |
| 9 import optparse | 9 import optparse |
| 10 import os | 10 import os |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 manifest_file.write(rendered_without_comments) | 36 manifest_file.write(rendered_without_comments) |
| 37 | 37 |
| 38 | 38 |
| 39 def main(): | 39 def main(): |
| 40 parser = optparse.OptionParser(description=__doc__) | 40 parser = optparse.OptionParser(description=__doc__) |
| 41 parser.usage = '%prog [options] <template_manifest_path>' | 41 parser.usage = '%prog [options] <template_manifest_path>' |
| 42 parser.add_option( | 42 parser.add_option( |
| 43 '-o', '--output_manifest', action='store', metavar='OUTPUT_MANIFEST', | 43 '-o', '--output_manifest', action='store', metavar='OUTPUT_MANIFEST', |
| 44 help='File to place generated manifest') | 44 help='File to place generated manifest') |
| 45 parser.add_option( | 45 parser.add_option( |
| 46 '-g', '--is_guest_manifest', action='store', metavar='GUEST_MANIFEST', | 46 '--is_guest_manifest', action='store', metavar='NUM', |
| 47 help='Generate a guest mode capable manifest') | 47 help='Whether to generate a guest mode capable manifest') |
| 48 parser.add_option( | 48 parser.add_option( |
| 49 '--use_chromevox_next', action='store', metavar='CHROMEVOX2', | 49 '--is_chromevox_next', action='store', metavar='NUM', |
| 50 help='Generate a ChromeVox next manifest') | 50 help='Whether to generate a ChromeVox Next manifest') |
| 51 parser.add_option( |
| 52 '--is_js_compressed', action='store', metavar='NUM', |
| 53 help='Whether compressed JavaScript files are used') |
| 51 parser.add_option( | 54 parser.add_option( |
| 52 '--set_version', action='store', metavar='SET_VERSION', | 55 '--set_version', action='store', metavar='SET_VERSION', |
| 53 help='Set the extension version') | 56 help='Set the extension version') |
| 54 parser.add_option( | 57 parser.add_option( |
| 55 '--key', action='store', metavar='KEY', | 58 '--key', action='store', metavar='KEY', |
| 56 help='Set the extension key') | 59 help='Set the extension key') |
| 57 | 60 |
| 58 options, args = parser.parse_args() | 61 options, args = parser.parse_args() |
| 59 if len(args) != 1: | 62 if len(args) != 1: |
| 60 print >>sys.stderr, 'Expected exactly one argument' | 63 print >>sys.stderr, 'Expected exactly one argument' |
| 61 sys.exit(1) | 64 sys.exit(1) |
| 62 processJinjaTemplate(args[0], options.output_manifest, parser.values.__dict__) | 65 processJinjaTemplate(args[0], options.output_manifest, parser.values.__dict__) |
| 63 | 66 |
| 64 if __name__ == '__main__': | 67 if __name__ == '__main__': |
| 65 main() | 68 main() |
| OLD | NEW |