diff options
| author | bwarsaw | 2003-05-12 05:48:10 +0000 |
|---|---|---|
| committer | bwarsaw | 2003-05-12 05:48:10 +0000 |
| commit | c5d585492d1a04d41a50a5fd223379f39ad8d8ce (patch) | |
| tree | 74c550b7fa7db5357d37722084deef83640ebddd /cron | |
| parent | 62af4eba4ce7fdf632eb49eb13913c0a5dbc8c40 (diff) | |
| download | mailman-c5d585492d1a04d41a50a5fd223379f39ad8d8ce.tar.gz mailman-c5d585492d1a04d41a50a5fd223379f39ad8d8ce.tar.zst mailman-c5d585492d1a04d41a50a5fd223379f39ad8d8ce.zip | |
open_newsgroup(): mlist.nntp_host may now be a host:port pair.
Diffstat (limited to 'cron')
| -rwxr-xr-x | cron/gate_news | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cron/gate_news b/cron/gate_news index 3fe466d4a..19ccb2c68 100755 --- a/cron/gate_news +++ b/cron/gate_news @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2003 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -67,6 +67,13 @@ class _ContinueLoop(Exception): pass +try: + True, False +except NameError: + True = 1 + False = 0 + + def usage(status, msg=''): if code: @@ -83,12 +90,15 @@ def usage(status, msg=''): _hostcache = {} def open_newsgroup(mlist): + # Split host:port if given + nntp_host, nntp_port = Utils.nntpsplit(mlist.nntp_host) # Open up a "mode reader" connection to nntp server. This will be shared # for all the gated lists having the same nntp_host. conn = _hostcache.get(mlist.nntp_host) if conn is None: try: - conn = nntplib.NNTP(mlist.nntp_host, readermode=1, + conn = nntplib.NNTP(nntp_host, nntp_port, + readermode=True, user=mm_cfg.NNTP_USERNAME, password=mm_cfg.NNTP_PASSWORD) except (socket.error, nntplib.NNTPError, IOError), e: |
