From 19f960485109224125e67b846f6c234a4e2db19f Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 14 Jun 2020 20:15:49 +0200 Subject: [PATCH] supybot-wizard: Fix handling of channel keys. The keys should be in a separate configuration variable, not be concatenated with the channels themselves. --- scripts/supybot-wizard | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/supybot-wizard b/scripts/supybot-wizard index 8df2a1e1a..188c3c1c3 100644 --- a/scripts/supybot-wizard +++ b/scripts/supybot-wizard @@ -534,9 +534,23 @@ def main(): by a comma. For example: #supybot-bots #mychannel,mykey #otherchannel"""); while True: - channels = something('What channels?', default=defaultChannels) + channels_input = something('What channels?', default=defaultChannels) + channels = [] + for channel in channels_input.split(): + L = channel.split(',') + if len(L) == 0: + continue + elif len(L) == 1: + (channel,) = L + channels.append(channel) + elif len(L) == 2: + (channel, key) = L + channels.append(channel) + network.channels.key.get(channel).setValue(key) + else: + output("""Too man commas in %s.""" % channel) try: - network.channels.set(channels) + network.channels.set(' '.join(channels)) break except registry.InvalidRegistryValue as e: output(""""%s" is an invalid IRC channel. Be sure to prefix