OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 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 |
| 4 # found in the LICENSE file. |
| 5 |
| 6 import logging |
| 7 |
| 8 from google.appengine.ext import webapp |
| 9 from google.appengine.ext.webapp.util import run_wsgi_app |
| 10 from branch_utility import BranchUtility |
| 11 |
| 12 |
| 13 class MainPage(webapp.RequestHandler): |
| 14 def get(self): |
| 15 path = self.request.path.replace('/chrome/extensions/', '') |
| 16 if path[0] == '/': |
| 17 path = path.strip('/') |
| 18 logging.info(path) |
| 19 b_util = BranchUtility() |
| 20 branch = b_util.GetBranchNumberForURL(path) |
| 21 self.response.out.write(path + ' ' + branch + '<br/>') |
| 22 if branch == 'trunk': |
| 23 self.response.out.write('http://src.chromium.org/viewvc/chrome/trunk/') |
| 24 else: |
| 25 self.response.out.write( |
| 26 'http://src.chromium.org/viewvc/chrome/branches/' + branch) |
| 27 |
| 28 application = webapp.WSGIApplication([ |
| 29 ('/.*', MainPage), |
| 30 ], debug=False) |
| 31 |
| 32 |
| 33 def main(): |
| 34 run_wsgi_app(application) |
| 35 |
| 36 |
| 37 if __name__ == '__main__': |
| 38 main() |
OLD | NEW |