diff options
author | bwarsaw <> | 2003-09-22 02:29:51 +0000 |
---|---|---|
committer | bwarsaw <> | 2003-09-22 02:29:51 +0000 |
commit | 33ad4402b372695b9526f57c33dd8f05c0eeddb3 (patch) | |
tree | 22a731818f773f8bf4828a333f452049f1b04d82 /cron/gate_news | |
parent | c6e5c888e2cfc4829e02badf397d2b85b3f39f74 (diff) | |
download | mailman2-33ad4402b372695b9526f57c33dd8f05c0eeddb3.tar.gz mailman2-33ad4402b372695b9526f57c33dd8f05c0eeddb3.tar.xz mailman2-33ad4402b372695b9526f57c33dd8f05c0eeddb3.zip |
Backporting from the HEAD -- bin and cron scripts
Diffstat (limited to 'cron/gate_news')
-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 3fe466d4..19ccb2c6 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: |