From 1f9d794943d87430311a65efa9335dd088b0bd02 Mon Sep 17 00:00:00 2001 From: James Vega Date: Wed, 11 Feb 2004 23:39:47 +0000 Subject: [PATCH] Fix the Debian.version regexps and fully propagate the Zegrep -> Zgrep renaming that occured a few days ago. --- plugins/Debian.py | 6 +++--- test/test_Debian.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/Debian.py b/plugins/Debian.py index c48d569b7..105a5b19d 100644 --- a/plugins/Debian.py +++ b/plugins/Debian.py @@ -74,7 +74,7 @@ def configure(advanced): about two orders of magnitude slower. THIS MEANS IT WILL TAKE AGES TO RUN THIS COMMAND. Don't do this.""") if yn('Do you want to use a Python equivalent of zgrep?'): - conf.supybot.plugins.Debian.pythonZegrep.setValue(True) + conf.supybot.plugins.Debian.pythonZgrep.setValue(True) else: output('I\'ll disable file now.') conf.supybot.defaultCapabilities().add('-Debian.file') @@ -136,7 +136,7 @@ class Debian(callbacks.Privmsg, except re.error, e: irc.error("Error in regexp: %s" % e) return - if self.registryValue('pythonZegrep'): + if self.registryValue('pythonZgrep'): fd = gzip.open(self.contents) r = imap(lambda tup: tup[0], ifilter(lambda tup: tup[0], @@ -177,7 +177,7 @@ class Debian(callbacks.Privmsg, _debreflags = re.DOTALL | re.IGNORECASE _debbrre = re.compile(r'
  • ]+>(.*?) \(', _debreflags) - _debverre = re.compile(r'
    \d+?:(\S+):', _debreflags) + _debverre = re.compile(r'
    (?:\d+:)?(\S+):', _debreflags) _deblistre = re.compile(r'

    Package ([^<]+)

    (.*?)', _debreflags) _debBranches = ('stable', 'testing', 'unstable', 'experimental') def version(self, irc, msg, args): diff --git a/test/test_Debian.py b/test/test_Debian.py index a53af2c0d..dde602799 100644 --- a/test/test_Debian.py +++ b/test/test_Debian.py @@ -68,6 +68,8 @@ if network: r'^No package.*\(unstable\)') self.assertRegexp('debian version gaim', r'\d+ matches found:.*gaim.*\(stable') + self.assertRegexp('debian version linux-wlan', + r'\d+ matches found:.*linux-wlan.*') self.assertError('debian version unstable') def testDebfile(self):