mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-27 05:03:07 +01:00
AutoMode, Channel, Nickometer: fix invalid escape sequence DeprecationWarning
This commit is contained in:
parent
772862d49c
commit
304125cfd0
@ -108,7 +108,7 @@ class AutoMode(callbacks.Plugin):
|
||||
user = ircdb.users.getUser(ircdb.users.getUserId(msg.prefix))
|
||||
except KeyError:
|
||||
return
|
||||
pattern = re.compile('-|\+')
|
||||
pattern = re.compile(r'-|\+')
|
||||
for item in self.registryValue('extra', channel, network):
|
||||
try:
|
||||
username, modes = pattern.split(item, maxsplit=1)
|
||||
|
@ -620,7 +620,7 @@ class Channel(callbacks.Plugin):
|
||||
If you have the #channel,op capability, this will show you the
|
||||
current persistent bans on the <channel> that match the given
|
||||
mask, if any (returns all of them otherwise).
|
||||
Note that you can use * as a wildcard on masks and \* to match
|
||||
Note that you can use * as a wildcard on masks and \\* to match
|
||||
actual * in masks
|
||||
"""
|
||||
all_bans = ircdb.channels.getChannel(channel).bans
|
||||
|
@ -139,7 +139,7 @@ class Nickometer(callbacks.Plugin):
|
||||
nick=re.sub('^C--$', 'C', nick);
|
||||
|
||||
# Punish consecutive non-alphas
|
||||
matches=re.findall('[^\w\d]{2,}',nick)
|
||||
matches=re.findall(r'[^\w\d]{2,}',nick)
|
||||
for match in matches:
|
||||
score += self.punish(slowPow(10, len(match)),
|
||||
'%s consecutive non-alphas ' % len(match))
|
||||
@ -147,9 +147,9 @@ class Nickometer(callbacks.Plugin):
|
||||
# Remove balanced brackets ...
|
||||
while True:
|
||||
nickInitial = nick
|
||||
nick=re.sub('^([^()]*)(\()(.*)(\))([^()]*)$', '\1\3\5', nick, 1)
|
||||
nick=re.sub('^([^{}]*)(\{)(.*)(\})([^{}]*)$', '\1\3\5', nick, 1)
|
||||
nick=re.sub('^([^\[\]]*)(\[)(.*)(\])([^\[\]]*)$', '\1\3\5', nick, 1)
|
||||
nick = re.sub(r'^([^()]*)(\()(.*)(\))([^()]*)$', r'\1\3\5', nick, 1)
|
||||
nick = re.sub(r'^([^{}]*)(\{)(.*)(\})([^{}]*)$', r'\1\3\5', nick, 1)
|
||||
nick = re.sub(r'^([^\[\]]*)(\[)(.*)(\])([^\[\]]*)$', r'\1\3\5', nick, 1)
|
||||
if nick == nickInitial:
|
||||
break
|
||||
self.log.debug('Removed some matching brackets %r => %r',
|
||||
|
Loading…
Reference in New Issue
Block a user