Some format character changes, and a little more information on the "Topic exceeds maximum length" error message.

This commit is contained in:
Jeremy Fincher 2005-02-02 04:42:22 +00:00
parent 7b2dbcf6c4
commit 94bfb279e6

View File

@ -53,7 +53,7 @@ def getTopic(irc, msg, args, state, format=True):
separator = state.cb.registryValue('separator', state.channel) separator = state.cb.registryValue('separator', state.channel)
if separator in args[0]: if separator in args[0]:
irc.errorInvalid('topic', args[0], irc.errorInvalid('topic', args[0],
format('The topic must not include %s.', separator)) format('The topic must not include %q.', separator))
topic = args.pop(0) topic = args.pop(0)
if format: if format:
env = {'topic': topic} env = {'topic': topic}
@ -144,7 +144,8 @@ class Topic(callbacks.Privmsg):
if len(newTopic) > maxLen: if len(newTopic) > maxLen:
if self.registryValue('recognizeTopiclen', channel): if self.registryValue('recognizeTopiclen', channel):
irc.error(format('That topic is too long for this server ' irc.error(format('That topic is too long for this server '
'(maximum length: %s).', maxLen), '(maximum length: %i; this topic: %i).',
maxLen, len(newTopic)),
Raise=True) Raise=True)
except KeyError: except KeyError:
pass pass
@ -256,7 +257,7 @@ class Topic(callbacks.Privmsg):
topics = self._splitTopic(irc.state.getTopic(channel), channel) topics = self._splitTopic(irc.state.getTopic(channel), channel)
L = [] L = []
for (i, t) in enumerate(topics): for (i, t) in enumerate(topics):
L.append(format('%s: %s', i+1, utils.str.ellipsisify(t, 30))) L.append(format('%i: %s', i+1, utils.str.ellipsisify(t, 30)))
s = utils.str.commaAndify(L) s = utils.str.commaAndify(L)
irc.reply(s) irc.reply(s)
list = wrap(list, ['inChannel']) list = wrap(list, ['inChannel'])