| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 """<General description of {Toolname} here.> |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | 2 |
| 5 """Antibody is meant to audit reviews for the Chromium project. | 3 [TBD] Example invocation: |
| 6 | 4 ./run.py infra.tools.{toolname} <arguments> |
| 7 Example invocation: [TBD] | |
| 8 ./run.py infra.tools.antibody <arguments> | |
| 9 """ | 5 """ |
| 10 | |
| 11 # This file is untested, keep as little code as possible in there. | 6 # This file is untested, keep as little code as possible in there. |
| 12 | 7 |
| 13 import argparse | 8 import argparse |
| 14 import logging | 9 import logging |
| 15 import sys | 10 import sys |
| 16 | 11 |
| 17 from infra.tools.antibody import antibody | 12 from infra.tools.{toolname} import {toolname} |
| 18 import infra_libs.logs | 13 import infra_libs.logs |
| 19 | 14 |
| 20 | 15 |
| 21 # https://storage.googleapis.com/chromium-infra-docs/infra/html/logging.html | 16 # https://storage.googleapis.com/chromium-infra-docs/infra/html/logging.html |
| 22 LOGGER = logging.getLogger(__name__) | 17 LOGGER = logging.getLogger(__name__) |
| 23 | 18 |
| 24 | 19 |
| 25 def main(argv): | 20 def main(argv): |
| 26 parser = argparse.ArgumentParser( | 21 parser = argparse.ArgumentParser( |
| 27 prog="antibody", | 22 prog="{toolname}", |
| 28 description=sys.modules['__main__'].__doc__) | 23 description=sys.modules['__main__'].__doc__) |
| 29 antibody.add_argparse_options(parser) | 24 |
| 25 {toolname}.add_argparse_options(parser) |
| 30 infra_libs.logs.add_argparse_options(parser) | 26 infra_libs.logs.add_argparse_options(parser) |
| 31 _args = parser.parse_args(argv) | 27 _args = parser.parse_args(argv) |
| 32 | |
| 33 infra_libs.logs.process_argparse_options(parser) | 28 infra_libs.logs.process_argparse_options(parser) |
| 34 | 29 |
| 35 # Do more processing here | 30 # Do more processing here |
| 36 LOGGER.info('Antibody starting') | 31 LOGGER.info('{Toolname} starting.') |
| 37 | 32 |
| 38 | 33 |
| 39 if __name__ == '__main__': | 34 if __name__ == '__main__': |
| 40 sys.exit(main(sys.argv[1:])) | 35 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |