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

Side by Side Diff: app/models/package_version.py

Issue 173333003: Display dev version constraints based on current Dart team policies. (Closed) Base URL: git@github.com:dart-lang/pub-dartlang.git@master
Patch Set: Created 6 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 import copy 5 import copy
6 import json 6 import json
7 import tarfile 7 import tarfile
8 8
9 from google.appengine.api import memcache 9 from google.appengine.api import memcache
10 from google.appengine.ext import db 10 from google.appengine.ext import db
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 return map(self._import_for_library, self.libraries) 190 return map(self._import_for_library, self.libraries)
191 191
192 def _import_for_library(self, library): 192 def _import_for_library(self, library):
193 """Return the import information for a library in this package.""" 193 """Return the import information for a library in this package."""
194 return {'package': self.package.name, 'library': library} 194 return {'package': self.package.name, 'library': library}
195 195
196 @property 196 @property
197 def example_version_constraint(self): 197 def example_version_constraint(self):
198 """Return the example version constraint for this package.""" 198 """Return the example version constraint for this package."""
199 if self.version.in_initial_development: return str(self.version) 199 if self.version.in_initial_development:
200 return json.dumps(">=%s <%d.%d.0" %
201 (self.version, self.version.major, self.version.minor + 1))
200 return json.dumps( 202 return json.dumps(
201 ">=%s <%d.0.0" % (self.version, self.version.major + 1)) 203 ">=%s <%d.0.0" % (self.version, self.version.major + 1))
202 204
203 @property 205 @property
204 def storage_path(self): 206 def storage_path(self):
205 """The Cloud Storage path for this package.""" 207 """The Cloud Storage path for this package."""
206 # Use the canonical version for the cloud storage path for 208 # Use the canonical version for the cloud storage path for
207 # backwards-compatibility with package versions that were uploaded 209 # backwards-compatibility with package versions that were uploaded
208 # prior to storing non-canonicalized versions. 210 # prior to storing non-canonicalized versions.
209 return 'packages/%s-%s.tar.gz' % \ 211 return 'packages/%s-%s.tar.gz' % \
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 263
262 if full: 264 if full:
263 value.update({ 265 value.update({
264 'created': self.created.isoformat(), 266 'created': self.created.isoformat(),
265 'downloads': self.downloads, 267 'downloads': self.downloads,
266 'libraries': self.libraries, 268 'libraries': self.libraries,
267 'uploader': self.uploader.email() 269 'uploader': self.uploader.email()
268 }) 270 })
269 271
270 return value 272 return value
OLDNEW
« 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