AutoMode, Channel, Nickometer: fix invalid escape sequence DeprecationWarning

This commit is contained in:
James Lu 2020-01-26 11:20:21 -08:00
parent 772862d49c
commit 304125cfd0
3 changed files with 6 additions and 6 deletions

View File

@ -108,7 +108,7 @@ class AutoMode(callbacks.Plugin):
user = ircdb.users.getUser(ircdb.users.getUserId(msg.prefix)) user = ircdb.users.getUser(ircdb.users.getUserId(msg.prefix))
except KeyError: except KeyError:
return return
pattern = re.compile('-|\+') pattern = re.compile(r'-|\+')
for item in self.registryValue('extra', channel, network): for item in self.registryValue('extra', channel, network):
try: try:
username, modes = pattern.split(item, maxsplit=1) username, modes = pattern.split(item, maxsplit=1)

View File

@ -620,7 +620,7 @@ class Channel(callbacks.Plugin):
If you have the #channel,op capability, this will show you the If you have the #channel,op capability, this will show you the
current persistent bans on the <channel> that match the given current persistent bans on the <channel> that match the given
mask, if any (returns all of them otherwise). 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 actual * in masks
""" """
all_bans = ircdb.channels.getChannel(channel).bans all_bans = ircdb.channels.getChannel(channel).bans

View File

@ -139,7 +139,7 @@ class Nickometer(callbacks.Plugin):
nick=re.sub('^C--$', 'C', nick); nick=re.sub('^C--$', 'C', nick);
# Punish consecutive non-alphas # Punish consecutive non-alphas
matches=re.findall('[^\w\d]{2,}',nick) matches=re.findall(r'[^\w\d]{2,}',nick)
for match in matches: for match in matches:
score += self.punish(slowPow(10, len(match)), score += self.punish(slowPow(10, len(match)),
'%s consecutive non-alphas ' % len(match)) '%s consecutive non-alphas ' % len(match))
@ -147,9 +147,9 @@ class Nickometer(callbacks.Plugin):
# Remove balanced brackets ... # Remove balanced brackets ...
while True: while True:
nickInitial = nick nickInitial = nick
nick=re.sub('^([^()]*)(\()(.*)(\))([^()]*)$', '\1\3\5', nick, 1) nick = re.sub(r'^([^()]*)(\()(.*)(\))([^()]*)$', r'\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('^([^\[\]]*)(\[)(.*)(\])([^\[\]]*)$', '\1\3\5', nick, 1) nick = re.sub(r'^([^\[\]]*)(\[)(.*)(\])([^\[\]]*)$', r'\1\3\5', nick, 1)
if nick == nickInitial: if nick == nickInitial:
break break
self.log.debug('Removed some matching brackets %r => %r', self.log.debug('Removed some matching brackets %r => %r',