Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/appengine_wrappers.py |
| diff --git a/chrome/common/extensions/docs/server2/appengine_wrappers.py b/chrome/common/extensions/docs/server2/appengine_wrappers.py |
| index 86a43e4940fc6268f32b6b3ffd8f8d476a45eb29..87acdddc245e63cac1d89057327b91b049aa99e4 100644 |
| --- a/chrome/common/extensions/docs/server2/appengine_wrappers.py |
| +++ b/chrome/common/extensions/docs/server2/appengine_wrappers.py |
| @@ -3,13 +3,17 @@ |
| # found in the LICENSE file. |
| import os |
| +import re |
| from app_yaml_helper import AppYamlHelper |
| def GetAppVersion(): |
| if 'CURRENT_VERSION_ID' in os.environ: |
| - # The version ID looks like 2-0-25.36712548, we only want the 2-0-25. |
| - return os.environ['CURRENT_VERSION_ID'].split('.', 1)[0] |
| + # The version ID looks like 2-0-25.36712548 or on the backend |
| + # backend_name:2-0-25.23982345. We only want the 2-0-25. |
|
方觉(Fang Jue)
2013/08/14 01:47:42
Backend's version ID will look like <backend-name>
|
| + return re.match( |
| + r'(?:[_\w-]+:)?(\d+-\d+-\d+)\.\d+$', |
| + os.environ['CURRENT_VERSION_ID']).group(1) |
| # Not running on appengine, get it from the app.yaml file ourselves. |
| app_yaml_path = os.path.join(os.path.split(__file__)[0], 'app.yaml') |
| with open(app_yaml_path, 'r') as app_yaml: |