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 HTTP server for our HTML rebaseline viewer. | 9 HTTP server for our HTML rebaseline viewer. |
10 """ | 10 """ |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 | 191 |
192 class HTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): | 192 class HTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): |
193 """ HTTP request handlers for various types of queries this server knows | 193 """ HTTP request handlers for various types of queries this server knows |
194 how to handle (static HTML and Javascript, expected/actual results, etc.) | 194 how to handle (static HTML and Javascript, expected/actual results, etc.) |
195 """ | 195 """ |
196 def do_GET(self): | 196 def do_GET(self): |
197 """ Handles all GET requests, forwarding them to the appropriate | 197 """ Handles all GET requests, forwarding them to the appropriate |
198 do_GET_* dispatcher. """ | 198 do_GET_* dispatcher. """ |
199 if self.path == '' or self.path == '/' or self.path == '/index.html' : | 199 if self.path == '' or self.path == '/' or self.path == '/index.html' : |
200 self.redirect_to('/static/view.html?resultsToLoad=all') | 200 self.redirect_to('/static/index.html') |
201 return | 201 return |
202 if self.path == '/favicon.ico' : | 202 if self.path == '/favicon.ico' : |
203 self.redirect_to('/static/favicon.ico') | 203 self.redirect_to('/static/favicon.ico') |
204 return | 204 return |
205 | 205 |
206 # All requests must be of this form: | 206 # All requests must be of this form: |
207 # /dispatcher/remainder | 207 # /dispatcher/remainder |
208 # where 'dispatcher' indicates which do_GET_* dispatcher to run | 208 # where 'dispatcher' indicates which do_GET_* dispatcher to run |
209 # and 'remainder' is the remaining path sent to that dispatcher. | 209 # and 'remainder' is the remaining path sent to that dispatcher. |
210 normpath = posixpath.normpath(self.path) | 210 normpath = posixpath.normpath(self.path) |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 args = parser.parse_args() | 438 args = parser.parse_args() |
439 global _SERVER | 439 global _SERVER |
440 _SERVER = Server(actuals_dir=args.actuals_dir, | 440 _SERVER = Server(actuals_dir=args.actuals_dir, |
441 expectations_dir=args.expectations_dir, | 441 expectations_dir=args.expectations_dir, |
442 port=args.port, export=args.export, editable=args.editable, | 442 port=args.port, export=args.export, editable=args.editable, |
443 reload_seconds=args.reload) | 443 reload_seconds=args.reload) |
444 _SERVER.run() | 444 _SERVER.run() |
445 | 445 |
446 if __name__ == '__main__': | 446 if __name__ == '__main__': |
447 main() | 447 main() |
OLD | NEW |