Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Unified Diff: chrome/common/extensions/docs/server2/appengine_wrappers.py

Issue 14247024: Devserver: allow SubversionFileSystem to be pinned to a specific rev on construction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 745ec35fbee58b1ffc10a6b0fd021d62e291bb6e..86a43e4940fc6268f32b6b3ffd8f8d476a45eb29 100644
--- a/chrome/common/extensions/docs/server2/appengine_wrappers.py
+++ b/chrome/common/extensions/docs/server2/appengine_wrappers.py
@@ -4,19 +4,16 @@
import os
+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]
- # Not running on appengine, get it from the app.yaml file ourselves. We
- # could properly parse this using a yaml library but Python doesn't have
- # one built in so whatevs.
- version_key = 'version:'
+ # 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:
- version_line = [line for line in app_yaml.read().split('\n')
- if line.startswith(version_key)][0]
- return version_line[len(version_key):].strip()
+ return AppYamlHelper.ExtractVersion(app_yaml.read())
def IsDevServer():
return os.environ.get('SERVER_SOFTWARE', '').find('Development') == 0

Powered by Google App Engine
This is Rietveld 408576698