| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 ''' | 3 ''' |
| 4 Copyright 2013 Google Inc. | 4 Copyright 2013 Google Inc. |
| 5 | 5 |
| 6 Use of this source code is governed by a BSD-style license that can be | 6 Use of this source code is governed by a BSD-style license that can be |
| 7 found in the LICENSE file. | 7 found in the LICENSE file. |
| 8 ''' | 8 ''' |
| 9 | 9 |
| 10 ''' | 10 ''' |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 parser.add_argument('--expectations-dir', | 207 parser.add_argument('--expectations-dir', |
| 208 help=('Directory under which to find GM expectations; ' | 208 help=('Directory under which to find GM expectations; ' |
| 209 'defaults to %(default)s'), | 209 'defaults to %(default)s'), |
| 210 default=DEFAULT_EXPECTATIONS_DIR) | 210 default=DEFAULT_EXPECTATIONS_DIR) |
| 211 parser.add_argument('--export', action='store_true', | 211 parser.add_argument('--export', action='store_true', |
| 212 help=('Instead of only allowing access from HTTP clients ' | 212 help=('Instead of only allowing access from HTTP clients ' |
| 213 'on localhost, allow HTTP clients on other hosts ' | 213 'on localhost, allow HTTP clients on other hosts ' |
| 214 'to access this server. WARNING: doing so will ' | 214 'to access this server. WARNING: doing so will ' |
| 215 'allow users on other hosts to modify your ' | 215 'allow users on other hosts to modify your ' |
| 216 'GM expectations!')) | 216 'GM expectations!')) |
| 217 parser.add_argument('--port', | 217 parser.add_argument('--port', type=int, |
| 218 help=('Which TCP port to listen on for HTTP requests; ' | 218 help=('Which TCP port to listen on for HTTP requests; ' |
| 219 'defaults to %(default)s'), | 219 'defaults to %(default)s'), |
| 220 default=DEFAULT_PORT) | 220 default=DEFAULT_PORT) |
| 221 args = parser.parse_args() | 221 args = parser.parse_args() |
| 222 global _SERVER | 222 global _SERVER |
| 223 _SERVER = Server(expectations_dir=args.expectations_dir, | 223 _SERVER = Server(expectations_dir=args.expectations_dir, |
| 224 port=args.port, export=args.export) | 224 port=args.port, export=args.export) |
| 225 _SERVER.run() | 225 _SERVER.run() |
| 226 | 226 |
| 227 if __name__ == '__main__': | 227 if __name__ == '__main__': |
| 228 main() | 228 main() |
| OLD | NEW |