OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # This is a preview server for the apps and extensions docs. Navigate to a docs | 6 # This is a preview server for the apps and extensions docs. Navigate to a docs |
7 # page, and the page will be rendered how it will be on the production server. | 7 # page, and the page will be rendered how it will be on the production server. |
8 # | 8 # |
9 # For example: http://localhost:8000/tabs.html will render the docs page for | 9 # For example: http://localhost:8000/tabs.html will render the docs page for |
10 # the tabs API. | 10 # the tabs API. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 print('Starting previewserver on port %s' % opts.port) | 63 print('Starting previewserver on port %s' % opts.port) |
64 print('The extension documentation can be found at:') | 64 print('The extension documentation can be found at:') |
65 print('') | 65 print('') |
66 print(' http://localhost:%s' % opts.port) | 66 print(' http://localhost:%s' % opts.port) |
67 print('') | 67 print('') |
68 | 68 |
69 server = HTTPServer(('', int(opts.port)), RequestHandler) | 69 server = HTTPServer(('', int(opts.port)), RequestHandler) |
70 try: | 70 try: |
71 server.serve_forever() | 71 server.serve_forever() |
72 except KeyboardInterrupt: | |
73 pass | |
74 finally: | 72 finally: |
75 server.socket.close() | 73 server.socket.close() |
OLD | NEW |