~sambuddhabasu1/mailman/fix_mailman_run_error

« back to all changes in this revision

Viewing changes to src/mailman/handlers/to_usenet.py

  • Committer: Barry Warsaw
  • Date: 2012-04-01 18:53:38 UTC
  • mfrom: (7139.1.4 bug-967409)
  • Revision ID: barry@list.org-20120401185338-5qujo0c3kc9a8wtr
 * The `news` runner and queue has been renamed to the more accurate `nntp`.
   The runner has also been ported to Mailman 3 (LP: #967409).  Beta testers
   can can safely remove `$var_dir/queue/news`.

 * Configuration schema variable changes:
   [nntp]username -> [nntp]user
   [nntp]port (added)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Move the message to the mail->news queue."""
19
19
 
20
 
from __future__ import absolute_import, unicode_literals
 
20
from __future__ import absolute_import, print_function, unicode_literals
21
21
 
22
22
__metaclass__ = type
23
23
__all__ = [
50
50
    def process(self, mlist, msg, msgdata):
51
51
        """See `IHandler`."""
52
52
        # Short circuits.
53
 
        if not mlist.gateway_to_news or \
54
 
               msgdata.get('isdigest') or \
55
 
               msgdata.get('fromusenet'):
 
53
        if (not mlist.gateway_to_news or
 
54
            msgdata.get('isdigest') or
 
55
            msgdata.get('fromusenet')):
 
56
            # Short-circuit.
56
57
            return
57
 
        # sanity checks
 
58
        # Sanity checks.
58
59
        error = []
59
60
        if not mlist.linked_newsgroup:
60
61
            error.append('no newsgroup')
65
66
                      COMMASPACE.join(error))
66
67
            return
67
68
        # Put the message in the news runner's queue.
68
 
        config.switchboards['news'].enqueue(
 
69
        config.switchboards['nntp'].enqueue(
69
70
            msg, msgdata, listname=mlist.fqdn_listname)