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

Unified Diff: server/scripts/redirector.py

Issue 1331463003: even more redirects (Closed) Base URL: git@github.com:dart-lang/api.dartlang.org.git@master
Patch Set: Created 5 years, 3 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 | « server/app.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/scripts/redirector.py
diff --git a/server/scripts/redirector.py b/server/scripts/redirector.py
index b19d01b429b45c2df3d748da70f715de91f0f2ac..e379228d1e0b3ee230fc52696674cee7d25b239c 100644
--- a/server/scripts/redirector.py
+++ b/server/scripts/redirector.py
@@ -298,6 +298,17 @@ def redir_bare_lib_name(handler, *args, **kwargs):
# /1.12.0/dart-async => /1.12.0/dart-async/dart-async-library.html
return '/%s/dart-%s/dart-%s-library.html' % (version, libname, libname)
+# /dart_core.html => /stable/dart-core/dart-core-library.html
+def redir_legacy_lib(handler, *args, **kwargs):
+ libname = kwargs['libname']
+ return '/stable/dart-%s/dart-%s-library.html' % (libname, libname)
+
+# /dart_core/Iterable.html => /stable/dart-core/Iterable-class.html
+def redir_legacy_lib_class(handler, *args, **kwargs):
+ libname = kwargs['libname']
+ classname = kwargs['classname']
+ return '/stable/dart-%s/%s-class.html' % (libname, classname)
+
application = WSGIApplication(
[
# Legacy URL redirection schemes.
@@ -339,6 +350,12 @@ application = WSGIApplication(
Route('/be/latest', RedirectHandler,
defaults={'_uri': '/be'}),
+ Route('/dart_<libname:[\w]+>.html', RedirectHandler,
+ defaults={'_uri': redir_legacy_lib}),
+
+ Route('/dart_<libname:[\w]+>/<classname:[\w]+>.html', RedirectHandler,
+ defaults={'_uri': redir_legacy_lib_class}),
+
# temp routing till stable docs are rolled out
Route('/stable', RedirectHandler,
defaults={'_uri': redir_stable_latest}), #ApiDocs),
« no previous file with comments | « server/app.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698