~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-06-02 15:19:38 UTC
  • mfrom: (13144.1.3 notify-announce-list)
  • Revision ID: launchpad@pqm.canonical.com-20110602151938-tawdrs82nnt4fp3q
[r=wgrant][no-qa] Drop announce_list from notify() and
        PackageUpload.acceptFromQueue(), leaving it up to notify() internals.

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