| OLD | NEW |
| 1 # coding=utf-8 | 1 # coding=utf-8 |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Status management pages.""" | 6 """Status management pages.""" |
| 7 | 7 |
| 8 import datetime | 8 import datetime |
| 9 import json | 9 import json |
| 10 import re | 10 import re |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 class LinkableText(object): | 39 class LinkableText(object): |
| 40 """Turns arbitrary text into a set of links""" | 40 """Turns arbitrary text into a set of links""" |
| 41 | 41 |
| 42 GERRIT_URLS = { | 42 GERRIT_URLS = { |
| 43 'chrome': 'https://chrome-internal-review.googlesource.com', | 43 'chrome': 'https://chrome-internal-review.googlesource.com', |
| 44 'chromium': 'https://chromium-review.googlesource.com', | 44 'chromium': 'https://chromium-review.googlesource.com', |
| 45 } | 45 } |
| 46 | 46 |
| 47 WATERFALL_URLS = { | 47 WATERFALL_URLS = { |
| 48 'chromeos': 'http://chromegw/i/chromeos', | 48 'chromeos': 'https://uberchromegw.corp.google.com/i/chromeos', |
| 49 'chromiumos': 'http://build.chromium.org/p/chromiumos', | 49 'chromiumos': 'http://build.chromium.org/p/chromiumos', |
| 50 } | 50 } |
| 51 | 51 |
| 52 # Automatically linkify known strings for the user. | 52 # Automatically linkify known strings for the user. |
| 53 _CONVERTS = [] | 53 _CONVERTS = [] |
| 54 | 54 |
| 55 @classmethod | 55 @classmethod |
| 56 def register_converter(cls, regex, target, pretty, is_email, flags=re.I): | 56 def register_converter(cls, regex, target, pretty, is_email, flags=re.I): |
| 57 """Register a new conversion for creating links from text""" | 57 """Register a new conversion for creating links from text""" |
| 58 cls._CONVERTS.append( | 58 cls._CONVERTS.append( |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 else: | 407 else: |
| 408 put_status(Status(message=new_message, username=self.user.email())) | 408 put_status(Status(message=new_message, username=self.user.email())) |
| 409 self.redirect("/") | 409 self.redirect("/") |
| 410 | 410 |
| 411 | 411 |
| 412 def bootstrap(): | 412 def bootstrap(): |
| 413 # Guarantee that at least one instance exists. | 413 # Guarantee that at least one instance exists. |
| 414 if db.GqlQuery('SELECT __key__ FROM Status').get() is None: | 414 if db.GqlQuery('SELECT __key__ FROM Status').get() is None: |
| 415 Status(username='none', message='welcome to status').put() | 415 Status(username='none', message='welcome to status').put() |
| 416 LinkableText.bootstrap(BasePage.APP_NAME) | 416 LinkableText.bootstrap(BasePage.APP_NAME) |
| OLD | NEW |