~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/browser/queue.py

[r=benji][bug=795573,
 796233] On DistroSeries:+localpackagediffs ensure that the comment
 form is hidden after adding a new comment to a DistroSeriesDifference,
 prevent empty comments from being submitted,
 and add some animations and effects to make the UI less jarring and easier to
 follow.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Browser views for package queue."""
34
34
    ISourcePackageReleaseFileSet,
35
35
    )
36
36
from lp.soyuz.interfaces.packageset import IPackagesetSet
37
 
from lp.soyuz.interfaces.publishing import (
38
 
    name_priority_map,
39
 
    )
 
37
from lp.soyuz.interfaces.publishing import name_priority_map
40
38
from lp.soyuz.interfaces.queue import (
41
39
    IPackageUpload,
42
40
    IPackageUploadSet,
159
157
                pkg_upload_source.sourcepackagerelease.id] = pkg_upload_source
160
158
        return package_upload_source_dict
161
159
 
162
 
    def source_fies_dict(self, package_upload_source_dict, source_files):
 
160
    def source_files_dict(self, package_upload_source_dict, source_files):
163
161
        """Return a dictionary of source files keyed on PackageUpload ID."""
164
162
        source_upload_files = {}
165
163
        for source_file in source_files:
215
213
        # Get a dictionary of lists of source files keyed by upload ID.
216
214
        package_upload_source_dict = self.source_dict(
217
215
            upload_ids, source_files)
218
 
        source_upload_files = self.source_fies_dict(
 
216
        source_upload_files = self.source_files_dict(
219
217
            package_upload_source_dict, source_files)
220
218
 
221
219
        # Get a list of binary package names that already exist in
224
222
        self.old_binary_packages = self.calculateOldBinaries(
225
223
            binary_package_names)
226
224
 
227
 
        return [CompletePackageUpload(item, build_upload_files,
228
 
                                      source_upload_files)
229
 
                for item in uploads]
 
225
        return [
 
226
            CompletePackageUpload(
 
227
                item, build_upload_files, source_upload_files)
 
228
            for item in uploads]
230
229
 
231
230
    def is_new(self, binarypackagerelease):
232
231
        """Return True if the binarypackagerelease has no ancestry."""
322
321
        queue_set = getUtility(IPackageUploadSet)
323
322
 
324
323
        if accept:
325
 
            header = 'Accepting Results:\n'
326
324
            action = "accept"
327
325
        elif reject:
328
 
            header = 'Rejecting Results:\n'
329
326
            action = "reject"
330
327
 
331
328
        success = []
358
355
                continue
359
356
 
360
357
            feedback_interpolations = {
361
 
                "name"      : queue_item.displayname,
362
 
                "component" : "(unchanged)",
363
 
                "section"   : "(unchanged)",
364
 
                "priority"  : "(unchanged)",
 
358
                "name": queue_item.displayname,
 
359
                "component": "(unchanged)",
 
360
                "section": "(unchanged)",
 
361
                "priority": "(unchanged)",
365
362
                }
366
363
            if new_component:
367
364
                feedback_interpolations['component'] = new_component.name
454
451
        # Create a dictionary of binary files keyed by
455
452
        # binarypackagerelease.
456
453
        self.binary_packages = {}
457
 
        self.binary_files = build_upload_files.get(self.id, None)
458
 
        if self.binary_files is not None:
459
 
            for binary in self.binary_files:
460
 
                package = binary.binarypackagerelease
461
 
                if package not in self.binary_packages:
462
 
                    self.binary_packages[package] = []
463
 
                self.binary_packages[package].append(binary)
 
454
        for binary in build_upload_files.get(self.id, []):
 
455
            package = binary.binarypackagerelease
 
456
            self.binary_packages.setdefault(package, []).append(binary)
464
457
 
465
458
        # Create a list of source files if this is a source upload.
466
459
        self.source_files = source_upload_files.get(self.id, None)
498
491
                self.sourcepackagerelease.sourcepackagename,
499
492
                distroseries=self.distroseries,
500
493
                direct_inclusion=True)))
501