mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Some kind of little cleanup. There was a pluralize call that used the wrong order for its arguments.
This commit is contained in:
parent
a3edca49a0
commit
751090a556
@ -215,7 +215,8 @@ class Bugzilla(callbacks.PrivmsgCommandAndRegexp, configurable.Mixin):
|
||||
|
||||
def urlquery2bugslist(self, url, query):
|
||||
"""Given a URL and query list for a CSV bug list, it'll return
|
||||
all the bugs in a dict """
|
||||
all the bugs in a dict
|
||||
"""
|
||||
u = urllib2.urlopen(url + '/buglist.cgi', string.join(query, '&'))
|
||||
# actually read in the file
|
||||
csvreader = csv.reader(u)
|
||||
@ -233,7 +234,6 @@ class Bugzilla(callbacks.PrivmsgCommandAndRegexp, configurable.Mixin):
|
||||
for f in fields[1:]:
|
||||
bugs[bugid][f] = bug[i]
|
||||
i += 1
|
||||
|
||||
u.close()
|
||||
return bugs
|
||||
|
||||
@ -264,15 +264,10 @@ class Bugzilla(callbacks.PrivmsgCommandAndRegexp, configurable.Mixin):
|
||||
bugs = self.urlquery2bugslist(url, query)
|
||||
bugids = bugs.keys()
|
||||
bugids.sort()
|
||||
|
||||
outputstr = '%d %s match \'%s\' (%s):' % (len(bugs), \
|
||||
utils.pluralize(len(bugs), 'bug'),
|
||||
searchstr, utils.commaAndify(keywords, And='AND'))
|
||||
|
||||
for b in bugids:
|
||||
outputstr += ' %s' % (str(b))
|
||||
|
||||
irc.reply(msg, outputstr)
|
||||
s = '%s match %r (%s): %s.' % \
|
||||
(utils.nItems('bug', len(bugs)), searchstr,
|
||||
' AND '.join(keywords), utils.commaAndify(map(str, bugids)))
|
||||
irc.reply(msg, s)
|
||||
|
||||
def bug(self, irc, msg, args):
|
||||
"""<abbreviation> <number>
|
||||
|
@ -33,13 +33,18 @@ from testsupport import *
|
||||
|
||||
class BugzillaTest(PluginTestCase, PluginDocumentation):
|
||||
plugins = ('Bugzilla',)
|
||||
def test(self):
|
||||
def testBug(self):
|
||||
self.assertNotError('bug gcc 5')
|
||||
self.assertNotError('search --keywords=fixed gcc alpha')
|
||||
self.assertNotError('search gcc alpha')
|
||||
|
||||
def testAddRemove(self):
|
||||
self.assertNotError('add xiph http://bugs.xiph.org/ Xiph')
|
||||
self.assertNotError('bug xiph 413')
|
||||
self.assertNotError('remove xiph')
|
||||
self.assertError('bug xiph 413')
|
||||
|
||||
def testSearch(self):
|
||||
self.assertNotError('search gcc alpha')
|
||||
self.assertNotError('search --keywords=fixed gcc alpha')
|
||||
|
||||
def testConfigBugzillaSnarfer(self):
|
||||
self.assertNotError('bugzilla config bug-snarfer off')
|
||||
|
Loading…
Reference in New Issue
Block a user