mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-20 15:41:09 +01:00
Nice ChannelDB...
This commit is contained in:
parent
731b95a146
commit
1863c8b6ad
@ -63,10 +63,24 @@ except ImportError:
|
|||||||
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
|
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
|
||||||
'plugin. Download it at <http://pysqlite.sf.net/>'
|
'plugin. Download it at <http://pysqlite.sf.net/>'
|
||||||
|
|
||||||
|
# I should write/copy a generalized proxy at some point.
|
||||||
|
class ReWrapper(object):
|
||||||
|
def __init__(self, L):
|
||||||
|
self.s = utils.dqrepr(' '.join(L))
|
||||||
|
self.r = re.compile('|'.join(imap(re.escape, L)))
|
||||||
|
|
||||||
|
def findall(self, *args, **kwargs):
|
||||||
|
return self.r.findall(*args, **kwargs)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.s
|
||||||
|
__repr__ = __str__
|
||||||
|
|
||||||
|
|
||||||
def SmileyType(s):
|
def SmileyType(s):
|
||||||
try:
|
try:
|
||||||
L = configurable.SpaceSeparatedStrListType(s)
|
L = configurable.SpaceSeparatedStrListType(s)
|
||||||
return re.compile('|'.join(imap(re.escape, L)))
|
return ReWrapper(L)
|
||||||
except configurable.Error:
|
except configurable.Error:
|
||||||
raise configurable.Error, 'Value must be a space-separated list of ' \
|
raise configurable.Error, 'Value must be a space-separated list of ' \
|
||||||
'smileys or frowns.'
|
'smileys or frowns.'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user