diff --git a/plugins/Debian.py b/plugins/Debian.py index 2e11c56c1..8c528bd4e 100644 --- a/plugins/Debian.py +++ b/plugins/Debian.py @@ -242,7 +242,7 @@ class Debian(callbacks.Privmsg, _incomingRe = re.compile(r'', re.I) def incoming(self, irc, msg, args): - """[--{regexp,arch}=] [] + """[--{regexp,arch}=] Checks debian incoming for a matching package name. The arch parameter defaults to i386; --regexp returns only those package names @@ -264,8 +264,11 @@ class Debian(callbacks.Privmsg, arg = '_%s.' % arg archPredicate = lambda s, arg=arg: (arg in s) predicates.append(archPredicate) - for arg in rest: - predicates.append(lambda s: fnmatch.fnmatch(s, arg)) + globs = privmsgs.getArgs(rest) + for glob in globs: + if '?' not in glob and '*' not in glob: + glob = '*%s*' % glob + predicates.append(lambda s: fnmatch.fnmatch(s, glob)) packages = [] fd = urllib2.urlopen('http://incoming.debian.org/') for line in fd: diff --git a/test/test_Debian.py b/test/test_Debian.py index 0fe5c5100..7c1f2abf5 100644 --- a/test/test_Debian.py +++ b/test/test_Debian.py @@ -58,6 +58,7 @@ class DebianTestCase(PluginTestCase, PluginDocumentation): pass def testDebversion(self): + self.assertHelp('debian version') self.assertRegexp('debian version lakjdfad', r'^No package.*\(all\)') self.assertRegexp('debian version unstable alkdjfad', r'^No package.*\(unstable\)') @@ -66,12 +67,13 @@ class DebianTestCase(PluginTestCase, PluginDocumentation): self.assertError('debian version unstable') def testDebfile(self): + self.assertHelp('file') if not self.fileDownloaded: pass self.assertRegexp('file --exact bin/gaim', r'net/gaim') def testDebincoming(self): - self.assertNotError('incoming') + self.assertHelp('incoming') # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: