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

Unified Diff: app/handlers/api/package_versions.py

Issue 104503011: Small CL to change the way format is used for package versions. (Closed) Base URL: https://github.com/dart-lang/pub-dartlang.git@master
Patch Set: Created 7 years 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 | test/test_handlers/api/test_package_versions.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/handlers/api/package_versions.py
diff --git a/app/handlers/api/package_versions.py b/app/handlers/api/package_versions.py
index 7ccc2f85289c0862b0bcc119fe339b6defefd9fe..1d963938454c6efbc7971f55703f2b062b054b94 100644
--- a/app/handlers/api/package_versions.py
+++ b/app/handlers/api/package_versions.py
@@ -164,10 +164,13 @@ class PackageVersions(object):
return ""
@handlers.api(2)
- def show(self, package_id, id, format):
+ def show(self, package_id, id, format=None):
"""Retrieve the document describing a package version."""
- # The mapper thinks the final version digit is the format.
- id = id + '.' + format
+ # The mapper expects anything past a period to be the format of the
+ # document, which is fine for "index.html" or "packages.json" but not
+ # for "1.2.3". It thinks "3" is the format, which is wrong, so we add it
+ # on here.
+ if format: id = id + '.' + format
return json.dumps(
handlers.request().package_version(id).as_dict(full=True))
« no previous file with comments | « no previous file | test/test_handlers/api/test_package_versions.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698