From ca037a94c5c43fd263e116242e42a7b39dfd187d Mon Sep 17 00:00:00 2001 From: Ken Spencer Date: Sat, 23 Sep 2017 09:51:00 -0400 Subject: [PATCH] Network: add all+server+channels and all+channels commands (#1305) * Network: add all+server+channels and all+channels commands * Network: fix up commands for PR as per @GLolol * Network: fix syntax docs, style, use irc.state.channels, not its keys * move acmd to Admin, remove cmdallchans, can be used by 'cmdall acmd ...' --- plugins/Admin/plugin.py | 10 ++++++++++ plugins/Network/plugin.py | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/Admin/plugin.py b/plugins/Admin/plugin.py index 5848b4322..ae6ebf1ff 100644 --- a/plugins/Admin/plugin.py +++ b/plugins/Admin/plugin.py @@ -350,6 +350,16 @@ class Admin(callbacks.Plugin): irc.replySuccess() clearq = wrap(clearq) + def acmd(self, irc, msg, args, commandAndArgs): + """ [ ...] + + Perform (with associated s on all channels on current network.""" + for channel in irc.state.channels: + msg.args[0] = channel + self.Proxy(irc, msg, commandAndArgs) + acmd = wrap(acmd, ['admin', many('something')]) + + Class = Admin diff --git a/plugins/Network/plugin.py b/plugins/Network/plugin.py index 592fd40fa..449029a68 100644 --- a/plugins/Network/plugin.py +++ b/plugins/Network/plugin.py @@ -157,7 +157,7 @@ class Network(callbacks.Plugin): command = wrap(command, ['admin', ('networkIrc', True), many('something')]) def cmdall(self, irc, msg, args, commandAndArgs): - """ ... + """ [ ...] Perform (with its associated s) on all networks. """ @@ -165,7 +165,7 @@ class Network(callbacks.Plugin): for ircd in ircs: self.Proxy(ircd, msg, commandAndArgs) cmdall = wrap(cmdall, ['admin', many('something')]) - + ### # whois command-related stuff. ###