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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 uploader/readme/changelog -> uploaderEmail/readmeString/changelogString | 84 uploader/readme/changelog -> uploaderEmail/readmeString/changelogString |
85 """ | 85 """ |
86 if self.uploader is None: | 86 if self.uploader is None: |
87 self.uploaderEmail = None | 87 self.uploaderEmail = None |
88 else: | 88 else: |
89 self.uploaderEmail = self.uploader.email() | 89 self.uploaderEmail = self.uploader.email() |
90 | 90 |
91 if self.readme: | 91 if self.readme: |
92 self.readmeFilename = self.readme.filename | 92 self.readmeFilename = self.readme.filename |
93 self.readmeContent = db.Text(self.readme.text, encoding="utf-8") | 93 self.readmeContent = db.Text(self.readme.text) |
94 | 94 |
95 if self.changelog: | 95 if self.changelog: |
96 self.changelogFilename = self.changelog.filename | 96 self.changelogFilename = self.changelog.filename |
97 self.changelogContent = db.Text(self.changelog.text, encoding="utf-8") | 97 self.changelogContent = db.Text(self.changelog.text) |
98 | 98 |
99 @classmethod | 99 @classmethod |
100 def new(cls, **kwargs): | 100 def new(cls, **kwargs): |
101 """Construct a new package version. | 101 """Construct a new package version. |
102 | 102 |
103 Unlike __init__, this infers some properties from others. In particular: | 103 Unlike __init__, this infers some properties from others. In particular: |
104 | 104 |
105 - The version is inferred from the pubspec. | 105 - The version is inferred from the pubspec. |
106 - The key name is set to the version. | 106 - The key name is set to the version. |
107 - The parent entity is set to the package. | 107 - The parent entity is set to the package. |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 316 |
317 if full: | 317 if full: |
318 value.update({ | 318 value.update({ |
319 'created': self.created.isoformat(), | 319 'created': self.created.isoformat(), |
320 'downloads': self.downloads, | 320 'downloads': self.downloads, |
321 'libraries': self.libraries, | 321 'libraries': self.libraries, |
322 'uploader': self.uploader.email() | 322 'uploader': self.uploader.email() |
323 }) | 323 }) |
324 | 324 |
325 return value | 325 return value |
OLD | NEW |