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 from cStringIO import StringIO | 5 from cStringIO import StringIO |
6 from contextlib import closing | 6 from contextlib import closing |
7 from uuid import uuid4 | 7 from uuid import uuid4 |
8 import json | 8 import json |
9 import logging | 9 import logging |
10 import time | 10 import time |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 if self._should_update_latest_version(version): | 99 if self._should_update_latest_version(version): |
100 version.package.latest_version = version | 100 version.package.latest_version = version |
101 else: | 101 else: |
102 version.package.latest_version = version | 102 version.package.latest_version = version |
103 | 103 |
104 cloud_storage.modify_object(version.storage_path, | 104 cloud_storage.modify_object(version.storage_path, |
105 acl='public-read', | 105 acl='public-read', |
106 copy_source='tmp/' + id) | 106 copy_source='tmp/' + id) |
107 | 107 |
108 with models.transaction(): | 108 with models.transaction(): |
| 109 version.package.temp_synchronize_uploaders_to_uploaderemails() |
109 version.package.put() | 110 version.package.put() |
| 111 version.temp_synchronize_uploader_to_uploaderemail_and_pickles() |
110 version.put() | 112 version.put() |
111 version.package.invalidate_cache() | 113 version.package.invalidate_cache() |
112 | 114 |
113 deferred.defer(self._compute_version_order, version.package.name) | 115 deferred.defer(self._compute_version_order, version.package.name) |
114 | 116 |
115 return handlers.json_success('%s %s uploaded successfully.' % | 117 return handlers.json_success('%s %s uploaded successfully.' % |
116 (version.package.name, version.version)) | 118 (version.package.name, version.version)) |
117 finally: | 119 finally: |
118 cloud_storage.delete_object('tmp/' + id) | 120 cloud_storage.delete_object('tmp/' + id) |
119 | 121 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 @handlers.requires_oauth_key | 181 @handlers.requires_oauth_key |
180 @handlers.requires_uploader | 182 @handlers.requires_uploader |
181 def new_dartdoc(self, package_id, id): | 183 def new_dartdoc(self, package_id, id): |
182 """Retrieve the form for uploading dartdoc for this package version.""" | 184 """Retrieve the form for uploading dartdoc for this package version.""" |
183 version = handlers.request().package_version(id) | 185 version = handlers.request().package_version(id) |
184 upload = cloud_storage.Upload(version.dartdoc_storage_path, | 186 upload = cloud_storage.Upload(version.dartdoc_storage_path, |
185 acl='public-read', | 187 acl='public-read', |
186 size_range=(0, Package.MAX_SIZE)) | 188 size_range=(0, Package.MAX_SIZE)) |
187 | 189 |
188 return upload.to_json() | 190 return upload.to_json() |
OLD | NEW |