~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: William Grant
  • Date: 2011-05-30 23:57:16 UTC
  • mto: This revision was merged to the branch mainline in revision 13140.
  • Revision ID: william.grant@canonical.com-20110530235716-765t1se330rz7s5g
Revert r13139. Messages are not unique over all of LP.

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
 
80
80
    def __init__(self, distribution_name, suite_name, queue, terms,
81
81
                 component_name, section_name, priority_name,
82
 
                 display, no_mail=True, exact_match=False, log=None):
 
82
                 announcelist, display, no_mail=True, exact_match=False,
 
83
                 log=None):
83
84
        """Initialises passed variables. """
84
85
        self.terms = terms
85
86
        # Some actions have addtional commands at the start of the terms
93
94
        self.no_mail = no_mail
94
95
        self.distribution_name = distribution_name
95
96
        self.suite_name = suite_name
 
97
        self.announcelist = announcelist
96
98
        self.default_sender = "%s <%s>" % (
97
99
            config.uploader.default_sender_name,
98
100
            config.uploader.default_sender_address)
110
112
            pocket=self.pocket)
111
113
 
112
114
    def setDefaultContext(self):
113
 
        """Set default distribuiton, distroseries."""
 
115
        """Set default distribuiton, distroseries, announcelist."""
114
116
        # if not found defaults to 'ubuntu'
115
117
 
116
118
        # Avoid circular imports.
138
140
            self.distroseries = self.distribution.currentseries
139
141
            self.pocket = PackagePublishingPocket.RELEASE
140
142
 
 
143
        if not self.announcelist:
 
144
            self.announcelist = self.distroseries.changeslist
 
145
 
141
146
    def initialize(self):
142
147
        """Builds a list of affected records based on the filter argument."""
143
148
        self.setDefaultContext()
478
483
            self.display('Accepting %s' % queue_item.displayname)
479
484
            try:
480
485
                queue_item.acceptFromQueue(
481
 
                    logger=self.log, dry_run=self.no_mail)
 
486
                    announce_list=self.announcelist, logger=self.log,
 
487
                    dry_run=self.no_mail)
482
488
            except QueueInconsistentStateError, info:
483
489
                self.display('** %s could not be accepted due to %s'
484
490
                             % (queue_item.displayname, info))
516
522
 
517
523
    def __init__(self, distribution_name, suite_name, queue, terms,
518
524
                 component_name, section_name, priority_name,
519
 
                 display, no_mail=True, exact_match=False, log=None):
 
525
                 announcelist, display, no_mail=True, exact_match=False,
 
526
                 log=None):
520
527
        """Constructor for QueueActionOverride."""
521
528
 
522
529
        # This exists so that self.terms_start_index can be set as this action
525
532
        # over-ride.
526
533
        QueueAction.__init__(self, distribution_name, suite_name, queue,
527
534
                             terms, component_name, section_name,
528
 
                             priority_name, display, no_mail=True,
529
 
                             exact_match=False, log=log)
 
535
                             priority_name, announcelist, display,
 
536
                             no_mail=True, exact_match=False, log=log)
530
537
        self.terms_start_index = 1
531
538
        self.overrides_performed = 0
532
539
 
658
665
    """A wrapper for queue_action classes."""
659
666
 
660
667
    def __init__(self, queue, distribution_name, suite_name,
661
 
                 no_mail, component_name, section_name, priority_name,
662
 
                 display=default_display, log=None):
 
668
                 announcelist, no_mail, component_name, section_name,
 
669
                 priority_name, display=default_display, log=None):
663
670
        self.queue = queue
664
671
        self.distribution_name = distribution_name
665
672
        self.suite_name = suite_name
 
673
        self.announcelist = announcelist
666
674
        self.no_mail = no_mail
667
675
        self.component_name = component_name
668
676
        self.section_name = section_name
693
701
            queue_action = queue_action_class(
694
702
                distribution_name=self.distribution_name,
695
703
                suite_name=self.suite_name,
 
704
                announcelist=self.announcelist,
696
705
                queue=self.queue,
697
706
                no_mail=self.no_mail,
698
707
                display=self.display,