Switch the Sourceforge plugin name to Sf

This commit is contained in:
James Vega 2003-10-21 12:20:23 +00:00
parent d2b993d2ec
commit e4909c5f42
2 changed files with 8 additions and 8 deletions

View File

@ -53,7 +53,7 @@ def configure(onStart, afterConnect, advanced):
# like to be run when the bot is started; append to afterConnect the # like to be run when the bot is started; append to afterConnect the
# commands you would like to be run when the bot has finished connecting. # commands you would like to be run when the bot has finished connecting.
from questions import expect, anything, something, yn from questions import expect, anything, something, yn
onStart.append('load Sourceforge') onStart.append('load Sf')
example = utils.wrapLines(""" example = utils.wrapLines("""
<@jamessan|work> @bugs <@jamessan|work> @bugs
@ -69,13 +69,13 @@ in 0.71, Bug #820961: dock icon doesn't show up with..., Bug #820879: Cannot con
< supybot> jamessan|work: Improve CLI interface <http://sourceforge.net/tracker/index.php?func=detail&aid=720757&group_id=75946&atid=545548> < supybot> jamessan|work: Improve CLI interface <http://sourceforge.net/tracker/index.php?func=detail&aid=720757&group_id=75946&atid=545548>
""") """)
class Sourceforge(callbacks.PrivmsgCommandAndRegexp): class Sf(callbacks.PrivmsgCommandAndRegexp):
""" """
Module for Sourceforge stuff. Currently contains commands to query a Module for Sourceforge stuff. Currently contains commands to query a
project's most recent bugs and rfes. project's most recent bugs and rfes.
""" """
threaded = True threaded = True
regexps = sets.Set(['sourceforgeSnarfer']) regexps = sets.Set(['sfSnarfer'])
_infoRe = re.compile(r'<td nowrap>(\d+)</td><td><a href="([^"]+)">'\ _infoRe = re.compile(r'<td nowrap>(\d+)</td><td><a href="([^"]+)">'\
'([^<]+)</a>', re.I) '([^<]+)</a>', re.I)
@ -242,7 +242,7 @@ class Sourceforge(callbacks.PrivmsgCommandAndRegexp):
_sfTitle = re.compile(r'Detail:(\d+) - ([^<]+)</title>', re.I) _sfTitle = re.compile(r'Detail:(\d+) - ([^<]+)</title>', re.I)
_linkType = re.compile(r'(\w+ \w+|\w+): Tracker Detailed View', re.I) _linkType = re.compile(r'(\w+ \w+|\w+): Tracker Detailed View', re.I)
def sourceforgeSnarfer(self, irc, msg, match): def sfSnarfer(self, irc, msg, match):
r"https?://(?:www\.)?sourceforge\.net/tracker/(?:index\.php)?\?func=detail&aid=\d+&group_id=\d+&atid=\d+" r"https?://(?:www\.)?sourceforge\.net/tracker/(?:index\.php)?\?func=detail&aid=\d+&group_id=\d+&atid=\d+"
if not self.snarfer: if not self.snarfer:
return return
@ -270,6 +270,6 @@ class Sourceforge(callbacks.PrivmsgCommandAndRegexp):
except Exception, e: except Exception, e:
irc.error(msg, debug.exnToString(e)) irc.error(msg, debug.exnToString(e))
Class = Sourceforge Class = Sf
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
### ###
# Copyright (c) 2002, Jeremiah Fincher # Copyright (c) 2003, James Vega
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -33,8 +33,8 @@ import re
from test import * from test import *
class SourceforgeTest(PluginTestCase, PluginDocumentation): class SfTest(PluginTestCase, PluginDocumentation):
plugins = ('Sourceforge',) plugins = ('Sf',)
def testBugs(self): def testBugs(self):
self.assertNotError('bugs') self.assertNotError('bugs')
self.assertResponse('bugs alkjfi83fa8', 'Can\'t find the "Bugs" link.') self.assertResponse('bugs alkjfi83fa8', 'Can\'t find the "Bugs" link.')