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

Unified Diff: utils/apidoc/app_engine/scripts/redirector.py

Issue 10850029: show current version used for api docs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/apidoc/app_engine/scripts/redirector.py
diff --git a/utils/apidoc/app_engine/scripts/redirector.py b/utils/apidoc/app_engine/scripts/redirector.py
index 6b8ff2b5802a0c8477a4084f88dea0faf90e1404..9687ff0babcd13966a5c47b0048a1684cbab37d2 100644
--- a/utils/apidoc/app_engine/scripts/redirector.py
+++ b/utils/apidoc/app_engine/scripts/redirector.py
@@ -105,7 +105,7 @@ class ApiDocs(blobstore_handlers.BlobstoreDownloadHandler):
def redir_to_latest(handler, *args, **kwargs):
path = kwargs['path']
- if re.search(r'^(core|coreimpl|crypto|io|isolate|json|uri|utf|web)', path):
+ if re.search(r'^(core|coreimpl|crypto|io|isolate|json|uri|html|math|utf|web)', path):
return '/docs/continuous/dart_' + path
else:
return '/docs/continuous/' + path
@@ -113,9 +113,15 @@ def redir_to_latest(handler, *args, **kwargs):
def redir_dom(handler, *args, **kwargs):
return '/docs/continuous/dart_html' + kwargs['path']
+class CurrentVersionHandler(RequestHandler):
+ def get(self, version):
+ self.response.headers['Content-Type'] = 'text/plain'
+ self.response.out.write(ApiDocs.latest_doc_version)
+
application = WSGIApplication(
[
Route('/dom<path:.*>', RedirectHandler, defaults={'_uri': redir_dom}),
+ Route('/currentversion/<version:.*>', CurrentVersionHandler),
('/docs.*', ApiDocs),
Route('/<path:.*>', RedirectHandler, defaults={'_uri': redir_to_latest})
],
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698