Call unqualified process/regexp_wrapper, since commands exports them now.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
James McCoy 2012-10-24 00:26:51 -04:00
parent 57e429011d
commit b5eac0994a
4 changed files with 10 additions and 9 deletions

View File

@ -35,7 +35,6 @@ import operator
import supybot.dbi as dbi
import supybot.log as log
import supybot.conf as conf
from supybot import commands
import supybot.utils as utils
import supybot.ircdb as ircdb
from supybot.commands import *
@ -293,8 +292,10 @@ class Note(callbacks.Plugin):
own = to
for (option, arg) in optlist:
if option == 'regexp':
criteria.append(lambda x: commands.regexp_wrapper(x, reobj=arg,
timeout=0.1, plugin_name=self.name(), fcn_name='search'))
criteria.append(lambda s:
regexp_wrapper(s, reobj=arg, timeout=0.1,
plugin_name=self.name(),
fcn_name='search'))
elif option == 'sent':
own = frm
if glob:

View File

@ -143,7 +143,7 @@ class String(callbacks.Plugin):
else:
t = self.registryValue('re.timeout')
try:
v = commands.process(f, text, timeout=t, pn=self.name(), cn='re')
v = process(f, text, timeout=t, pn=self.name(), cn='re')
irc.reply(v)
except commands.ProcessTimeoutError, e:
irc.error("ProcessTimeoutError: %s" % (e,))

View File

@ -35,7 +35,6 @@ import operator
import supybot.dbi as dbi
import supybot.conf as conf
from supybot import commands
import supybot.ircdb as ircdb
import supybot.utils as utils
from supybot.commands import *
@ -229,9 +228,10 @@ class Todo(callbacks.Plugin):
criteria = []
for (option, arg) in optlist:
if option == 'regexp':
criteria.append(lambda x: commands.regexp_wrapper(x, reobj=arg,
timeout=0.1, plugin_name=self.name(), fcn_name='search'))
criteria.append(arg.search)
criteria.append(lambda s:
regexp_wrapper(s, reobj=arg, timeout=0.1,
plugin_name=self.name(),
fcn_name='search'))
for glob in globs:
glob = utils.python.glob2re(glob)
criteria.append(re.compile(glob).search)

View File

@ -419,7 +419,7 @@ class ChannelIdDatabasePlugin(callbacks.Plugin):
if opt == 'by':
predicates.append(lambda r, arg=arg: r.by == arg.id)
elif opt == 'regexp':
predicates.append(lambda x: regexp_wrapper(x.text, reobj=arg,
predicates.append(lambda r: regexp_wrapper(r.text, reobj=arg,
timeout=0.1, plugin_name=self.name(), fcn_name='search'))
if glob:
def globP(r, glob=glob.lower()):