diff --git a/scripts/supybot-wizard b/scripts/supybot-wizard index a4e11ae67..2e662f36b 100644 --- a/scripts/supybot-wizard +++ b/scripts/supybot-wizard @@ -379,12 +379,11 @@ def main(): try: network.channels.set(channels) break - except registry.InvalidRegistryValue: - # FIXME: say which ones weren't channels. - output("""Not all of those are valid IRC channels. Be sure to - prefix the channel with # (or +, or !, or &, but no one uses - those channels, really). Be sure the channel key (if you are - supplying one) does not contain a comma.""") + except registry.InvalidRegistryValue, e: + output("""%s is an invalid IRC channel. Be sure to prefix the + channel with # (or +, or !, or &, but no one uses those + channels, really). Be sure the channel key (if you are + supplying one) does not contain a comma.""" % e.channel) else: network.channels.setValue([]) diff --git a/src/conf.py b/src/conf.py index fe26dbb34..fbb6d3c9d 100644 --- a/src/conf.py +++ b/src/conf.py @@ -161,6 +161,7 @@ class ValidNicksAllowingPercentS(ValidNicks): class ValidChannel(registry.String): """Value must be a valid IRC channel name.""" def setValue(self, v): + self.channel = v if ',' in v: # To prevent stupid users from: a) trying to add a channel key # with a comma in it, b) trying to add channels separated by @@ -176,6 +177,13 @@ class ValidChannel(registry.String): else: registry.String.setValue(self, v) + def error(self): + try: + super(ValidChannel, self).error() + except registry.InvalidRegistryValue, e: + e.channel = self.channel + raise e + class ValidHostmask(registry.String): """Value must be a valid user hostmask.""" def setValue(self, v):