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

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

Issue 14267024: Devserver: have a separate ObjectStore namespace (both memcache and datastore) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove _CheckVersions Created 7 years, 8 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 b6357422a492e4cd579a05772463c1513d4f74cd..cf0562d88869e4e0a5970ab3a92e28bd475e07c5 100644
--- a/chrome/common/extensions/docs/server2/appengine_wrappers.py
+++ b/chrome/common/extensions/docs/server2/appengine_wrappers.py
@@ -4,6 +4,19 @@
import os
+def GetAppVersion():
+ if 'CURRENT_VERSION_ID' in os.environ:
+ return os.environ['CURRENT_VERSION_ID']
+ # 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:'
+ 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()
+
def IsDevServer():
return os.environ.get('SERVER_SOFTWARE', '').find('Development') == 0

Powered by Google App Engine
This is Rietveld 408576698