From ce2bed4f49435b6066e0209f85e30cda7777df78 Mon Sep 17 00:00:00 2001 From: calvin Date: Fri, 14 Jul 2000 11:10:21 +0000 Subject: [PATCH] nntp: support git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@137 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- linkcheck/NntpUrlData.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/linkcheck/NntpUrlData.py b/linkcheck/NntpUrlData.py index b48b008d..09e36475 100644 --- a/linkcheck/NntpUrlData.py +++ b/linkcheck/NntpUrlData.py @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. """ -import re,string,time,nntplib,urlparse,linkcheck +import re,string,time,sys,nntplib,urlparse,linkcheck from linkcheck import _ from UrlData import ExcList,UrlData debug = linkcheck.Config.debug @@ -48,7 +48,7 @@ class NntpUrlData(UrlData): return nntp = self._connectNntp(nntpserver) group = self.urlTuple[2] - if group[:1]=='/': + while group[:1]=='/': group = group[1:] if '@' in group: # request article @@ -57,10 +57,14 @@ class NntpUrlData(UrlData): else: # split off trailing articel span group = string.split(group,'/',1)[0] - # request group info - resp,count,first,last,name = nntp.group(self.urlTuple[2]) - self.setInfo(_("Group %s has %s articles, range %s to %s") % \ - (name, count, first, last)) + if group: + # request group info + resp,count,first,last,name = nntp.group(group) + self.setInfo(_("Group %s has %s articles, range %s to %s") %\ + (name, count, first, last)) + else: + # group name is the empty string + self.setWarning(_("No newsgroup specified in NNTP URL")) def _connectNntp(self, nntpserver):