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

View File

@ -143,7 +143,7 @@ class String(callbacks.Plugin):
else: else:
t = self.registryValue('re.timeout') t = self.registryValue('re.timeout')
try: 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) irc.reply(v)
except commands.ProcessTimeoutError, e: except commands.ProcessTimeoutError, e:
irc.error("ProcessTimeoutError: %s" % (e,)) irc.error("ProcessTimeoutError: %s" % (e,))

View File

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

View File

@ -419,7 +419,7 @@ class ChannelIdDatabasePlugin(callbacks.Plugin):
if opt == 'by': if opt == 'by':
predicates.append(lambda r, arg=arg: r.by == arg.id) predicates.append(lambda r, arg=arg: r.by == arg.id)
elif opt == 'regexp': 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')) timeout=0.1, plugin_name=self.name(), fcn_name='search'))
if glob: if glob:
def globP(r, glob=glob.lower()): def globP(r, glob=glob.lower()):