| OLD | NEW |
| 1 #!/usr/bin/env python | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 # | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # Copyright 2010 Google Inc. All Rights Reserved. | 3 # found in the LICENSE file. |
| 4 | |
| 5 """Playback driver.""" | 4 """Playback driver.""" |
| 6 | 5 |
| 7 import cgi | 6 import cgi |
| 8 import simplejson as json | 7 import simplejson as json |
| 9 import os | 8 import os |
| 10 import string | 9 import string |
| 11 import sys | 10 import sys |
| 12 import threading | 11 import threading |
| 13 import urlparse | 12 import urlparse |
| 14 | 13 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 def _GetApplicationResource(self, handler): | 186 def _GetApplicationResource(self, handler): |
| 188 "Searches for response in cache. If not found, responds with 204." | 187 "Searches for response in cache. If not found, responds with 204." |
| 189 key = (handler.command, handler.path) | 188 key = (handler.command, handler.path) |
| 190 if key in self.cache: | 189 if key in self.cache: |
| 191 sys.stdout.write('%s %s -> found\n' % key) | 190 sys.stdout.write('%s %s -> found\n' % key) |
| 192 handler.wfile.write(self.cache[key]['response']) | 191 handler.wfile.write(self.cache[key]['response']) |
| 193 else: | 192 else: |
| 194 sys.stderr.write('%s %s -> not found\n' % key) | 193 sys.stderr.write('%s %s -> not found\n' % key) |
| 195 handler.send_response(204, "not in cache") | 194 handler.send_response(204, "not in cache") |
| 196 handler.end_headers() | 195 handler.end_headers() |
| OLD | NEW |