A little refactoring and make sure Sourceforge.tracker reports the URL since

bug/rfe used to
This commit is contained in:
James Vega 2004-04-16 16:31:17 +00:00
parent 68766a5c91
commit 6a7981aac0
1 changed files with 4 additions and 5 deletions

View File

@ -175,16 +175,15 @@ class Sourceforge(callbacks.PrivmsgCommandAndRegexp):
linktype = m.group(1) linktype = m.group(1)
linktype = utils.depluralize(linktype) linktype = utils.depluralize(linktype)
(num, desc) = n.groups() (num, desc) = n.groups()
head = '%s #%s:' % (ircutils.bold(linktype), num) head = '%s #%s: %s' % (ircutils.bold(linktype), num, desc)
resp.append(desc) resp.append(head)
else: else:
return None return None
for r in self._regexps: for r in self._regexps:
m = r.search(s) m = r.search(s)
if m: if m:
resp.append('%s: %s' % self._bold(m.groups())) resp.append('%s: %s' % self._bold(m.groups()))
return '%s #%s: %s' % (ircutils.bold(linktype), ircutils.bold(num), return '; '.join(resp)
'; '.join(resp))
except webutils.WebError, e: except webutils.WebError, e:
raise TrackerError, str(e) raise TrackerError, str(e)
@ -201,7 +200,7 @@ class Sourceforge(callbacks.PrivmsgCommandAndRegexp):
if resp is None: if resp is None:
irc.error('Invalid Tracker page snarfed: %s' % url) irc.error('Invalid Tracker page snarfed: %s' % url)
else: else:
irc.reply(resp) irc.reply('%s <%s>' % (resp, url))
except TrackerError, e: except TrackerError, e:
irc.error(str(e)) irc.error(str(e))