~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-06-25 08:55:37 UTC
  • mfrom: (13287.1.8 bug-800652)
  • Revision ID: launchpad@pqm.canonical.com-20110625085537-moikyoo2pe98zs7r
[r=jcsackett, julian-edwards][bug=800634,
        800652] Enable and display overrides on sync package uploads.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    QueueInconsistentStateError,
47
47
    )
48
48
from lp.soyuz.interfaces.section import ISectionSet
49
 
from lp.soyuz.model.queue import PackageUploadSource
50
49
 
51
50
 
52
51
QUEUE_SIZE = 30
199
198
        in the +queue template.
200
199
        """
201
200
        # Avoid circular imports.
 
201
        from lp.soyuz.model.queue import PackageUploadSource
202
202
        from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
203
203
 
204
204
        uploads = list(self.batchnav.currentBatch())
396
396
                               (queue_item.displayname, info))
397
397
            else:
398
398
                if source_overridden:
399
 
                    success.append("OK: %(name)s(%(component)s/%(section)s)" %
400
 
                                   feedback_interpolations)
 
399
                    desc = "%(name)s(%(component)s/%(section)s)"
401
400
                elif binary_overridden:
402
 
                    success.append(
403
 
                        "OK: %(name)s(%(component)s/%(section)s/%(priority)s)"
404
 
                            % feedback_interpolations)
 
401
                    desc = "%(name)s(%(component)s/%(section)s/%(priority)s)"
405
402
                else:
406
 
                    success.append('OK: %s' % queue_item.displayname)
 
403
                    desc = "%(name)s"
 
404
                success.append(
 
405
                    "OK: " + desc % feedback_interpolations)
407
406
 
408
407
        for message in success:
409
408
            self.request.response.addInfoNotification(message)
480
479
        # Create a list of source files if this is a source upload.
481
480
        self.source_files = source_upload_files.get(self.id, None)
482
481
 
483
 
        # Pre-fetch the sourcepackagerelease if it exists.
484
482
        if self.contains_source:
485
483
            self.sourcepackagerelease = self.sources[0].sourcepackagerelease
486
 
        else:
487
 
            self.sourcepackagerelease = None
488
484
 
489
485
        if self.contains_source:
490
486
            self.package_sets = package_sets.get(
513
509
    @property
514
510
    def display_package_sets(self):
515
511
        """Package sets, if any, for display on the +queue page."""
516
 
        if self.contains_source:
517
 
            return ' '.join(sorted(
518
 
                packageset.name for packageset in self.package_sets))
519
 
        else:
520
 
            return ""
 
512
        return ' '.join(sorted(
 
513
            packageset.name for packageset in self.package_sets))
521
514
 
522
515
    @property
523
516
    def display_component(self):
524
517
        """Component name, if any, for display on the +queue page."""
525
 
        if self.contains_source:
526
 
            return self.component_name.lower()
 
518
        component_name = self.component_name
 
519
        if component_name is None:
 
520
            return ""
527
521
        else:
528
 
            return ""
 
522
            return component_name.lower()
529
523
 
530
524
    @property
531
525
    def display_section(self):
532
526
        """Section name, if any, for display on the +queue page."""
533
 
        if self.contains_source:
534
 
            return self.section_name.lower()
 
527
        section_name = self.section_name
 
528
        if section_name is None:
 
529
            return ""
535
530
        else:
536
 
            return ""
 
531
            return section_name.lower()
537
532
 
538
533
    @property
539
534
    def display_priority(self):