Skip to content

Commit 8453be4

Browse files
authored
Merge pull request #2344 from sopel-irc/blocks-hostmask-rename
coretasks: `.blocks hostmask` -> `.blocks host`
2 parents a4f185d + da82135 commit 8453be4

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

sopel/coretasks.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,26 +1272,26 @@ def blocks(bot, trigger):
12721272
"success_del": "Successfully deleted block: %s",
12731273
"success_add": "Successfully added block: %s",
12741274
"no_nick": "No matching nick block found for: %s",
1275-
"no_host": "No matching hostmask block found for: %s",
1276-
"invalid": "Invalid format for %s a block. Try: .blocks add (nick|hostmask) sopel",
1275+
"no_host": "No matching host block found for: %s",
1276+
"invalid": "Invalid format for %s a block. Try: .blocks add (nick|host) sopel",
12771277
"invalid_display": "Invalid input for displaying blocks.",
12781278
"nonelisted": "No %s listed in the blocklist.",
12791279
'huh': "I could not figure out what you wanted to do.",
12801280
}
12811281

1282-
masks = set(s for s in bot.config.core.host_blocks if s != '')
1282+
hosts = set(s for s in bot.config.core.host_blocks if s != '')
12831283
nicks = set(bot.make_identifier(nick)
12841284
for nick in bot.config.core.nick_blocks
12851285
if nick != '')
12861286
text = trigger.group().split()
12871287

12881288
if len(text) == 3 and text[1] == "list":
1289-
if text[2] == "hostmask":
1290-
if len(masks) > 0:
1291-
blocked = ', '.join(str(mask) for mask in masks)
1292-
bot.say("Blocked hostmasks: {}".format(blocked))
1289+
if text[2] == "host":
1290+
if len(hosts) > 0:
1291+
blocked = ', '.join(str(host) for host in hosts)
1292+
bot.say("Blocked hosts: {}".format(blocked))
12931293
else:
1294-
bot.reply(STRINGS['nonelisted'] % ('hostmasks'))
1294+
bot.reply(STRINGS['nonelisted'] % ('hosts'))
12951295
elif text[2] == "nick":
12961296
if len(nicks) > 0:
12971297
blocked = ', '.join(str(nick) for nick in nicks)
@@ -1306,9 +1306,9 @@ def blocks(bot, trigger):
13061306
nicks.add(text[3])
13071307
bot.config.core.nick_blocks = nicks
13081308
bot.config.save()
1309-
elif text[2] == "hostmask":
1310-
masks.add(text[3].lower())
1311-
bot.config.core.host_blocks = list(masks)
1309+
elif text[2] == "host":
1310+
hosts.add(text[3].lower())
1311+
bot.config.core.host_blocks = list(hosts)
13121312
else:
13131313
bot.reply(STRINGS['invalid'] % ("adding"))
13141314
return
@@ -1325,13 +1325,13 @@ def blocks(bot, trigger):
13251325
bot.config.core.nick_blocks = [str(n) for n in nicks]
13261326
bot.config.save()
13271327
bot.reply(STRINGS['success_del'] % (text[3]))
1328-
elif text[2] == "hostmask":
1329-
mask = text[3].lower()
1330-
if mask not in masks:
1328+
elif text[2] == "host":
1329+
host = text[3].lower()
1330+
if host not in hosts:
13311331
bot.reply(STRINGS['no_host'] % (text[3]))
13321332
return
1333-
masks.remove(mask)
1334-
bot.config.core.host_blocks = [str(m) for m in masks]
1333+
hosts.remove(host)
1334+
bot.config.core.host_blocks = [str(m) for m in hosts]
13351335
bot.config.save()
13361336
bot.reply(STRINGS['success_del'] % (text[3]))
13371337
else:

0 commit comments

Comments
 (0)