| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/env python |
| 2 | |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # 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 |
| 5 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 6 | 5 |
| 7 """Constrained Network Server. Serves files with supplied network constraints. | 6 """Constrained Network Server. Serves files with supplied network constraints. |
| 8 | 7 |
| 9 The CNS exposes a web based API allowing network constraints to be imposed on | 8 The CNS exposes a web based API allowing network constraints to be imposed on |
| 10 file serving. | 9 file serving. |
| 11 | 10 |
| 12 TODO(dalecurtis): Add some more docs here. | 11 TODO(dalecurtis): Add some more docs here. |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 try: | 265 try: |
| 267 cherrypy.quickstart(ConstrainedNetworkServer(options, pa)) | 266 cherrypy.quickstart(ConstrainedNetworkServer(options, pa)) |
| 268 finally: | 267 finally: |
| 269 # Disable Ctrl-C handler to prevent interruption of cleanup. | 268 # Disable Ctrl-C handler to prevent interruption of cleanup. |
| 270 signal.signal(signal.SIGINT, lambda signal, frame: None) | 269 signal.signal(signal.SIGINT, lambda signal, frame: None) |
| 271 pa.Cleanup(all_ports=True) | 270 pa.Cleanup(all_ports=True) |
| 272 | 271 |
| 273 | 272 |
| 274 if __name__ == '__main__': | 273 if __name__ == '__main__': |
| 275 Main() | 274 Main() |
| OLD | NEW |