OLD | NEW |
---|---|
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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
237 | 237 |
238 return map(self._import_for_library, self.libraries) | 238 return map(self._import_for_library, self.libraries) |
239 | 239 |
240 def _import_for_library(self, library): | 240 def _import_for_library(self, library): |
241 """Return the import information for a library in this package.""" | 241 """Return the import information for a library in this package.""" |
242 return {'package': self.package.name, 'library': library} | 242 return {'package': self.package.name, 'library': library} |
243 | 243 |
244 @property | 244 @property |
245 def example_version_constraint(self): | 245 def example_version_constraint(self): |
246 """Return the example version constraint for this package.""" | 246 """Return the example version constraint for this package.""" |
247 if self.version.in_initial_development: | 247 if not self.verison.is_prerelease: |
248 return json.dumps(">=%s <%d.%d.0" % | 248 return json.dumps("^%s" % self.version) |
249 (self.version, self.version.major, self.version.minor + 1)) | 249 |
250 return json.dumps( | 250 return json.dumps(">=%s <%d.%d.%d" % ( |
251 ">=%s <%d.0.0" % (self.version, self.version.major + 1)) | 251 self.version, |
252 self.version.major, | |
253 self.version.minor, | |
254 self.version.patch | |
255 )) | |
kustermann
2015/05/19 08:24:36
I'm not sure if this is working as intended.
A wh
| |
252 | 256 |
253 @property | 257 @property |
254 def storage_path(self): | 258 def storage_path(self): |
255 """The Cloud Storage path for this package.""" | 259 """The Cloud Storage path for this package.""" |
256 # Use the canonical version for the cloud storage path for | 260 # Use the canonical version for the cloud storage path for |
257 # backwards-compatibility with package versions that were uploaded | 261 # backwards-compatibility with package versions that were uploaded |
258 # prior to storing non-canonicalized versions. | 262 # prior to storing non-canonicalized versions. |
259 return 'packages/%s-%s.tar.gz' % \ | 263 return 'packages/%s-%s.tar.gz' % \ |
260 (self.package.name, self.version.canonical) | 264 (self.package.name, self.version.canonical) |
261 | 265 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
311 | 315 |
312 if full: | 316 if full: |
313 value.update({ | 317 value.update({ |
314 'created': self.created.isoformat(), | 318 'created': self.created.isoformat(), |
315 'downloads': self.downloads, | 319 'downloads': self.downloads, |
316 'libraries': self.libraries, | 320 'libraries': self.libraries, |
317 'uploader': self.uploaderEmail | 321 'uploader': self.uploaderEmail |
318 }) | 322 }) |
319 | 323 |
320 return value | 324 return value |
OLD | NEW |