Index: chrome/common/extensions/docs/server2/echo_handler.py |
diff --git a/chrome/common/extensions/docs/server2/echo_handler.py b/chrome/common/extensions/docs/server2/echo_handler.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..7faecccb29d2950206817602a5189ddced034a8a |
--- /dev/null |
+++ b/chrome/common/extensions/docs/server2/echo_handler.py |
@@ -0,0 +1,38 @@ |
+#!/usr/bin/env python |
+# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import logging |
+ |
+from google.appengine.ext import webapp |
+from google.appengine.ext.webapp.util import run_wsgi_app |
+from branch_utility import BranchUtility |
+ |
+ |
+class MainPage(webapp.RequestHandler): |
+ def get(self): |
+ path = self.request.path.replace('/chrome/extensions/', '') |
+ if path[0] == '/': |
+ path = path.strip('/') |
+ logging.info(path) |
+ b_util = BranchUtility() |
+ branch = b_util.GetBranchNumberForURL(path) |
+ self.response.out.write(path + ' ' + branch + '<br/>') |
+ if branch == 'trunk': |
+ self.response.out.write('http://src.chromium.org/viewvc/chrome/trunk/') |
+ else: |
+ self.response.out.write( |
+ 'http://src.chromium.org/viewvc/chrome/branches/' + branch) |
+ |
+application = webapp.WSGIApplication([ |
+ ('/.*', MainPage), |
+], debug=False) |
+ |
+ |
+def main(): |
+ run_wsgi_app(application) |
+ |
+ |
+if __name__ == '__main__': |
+ main() |