utils.str.format: Replace %u with '' instead of '<>' if URL is empty.

This commit is contained in:
Valentin Lorentz 2013-08-13 19:19:54 +00:00
parent 3a5c4c3ddd
commit 8d7b06efd1

View File

@ -511,7 +511,11 @@ def format(s, *args, **kwargs):
return timeElapsed(args.pop()) return timeElapsed(args.pop())
elif char == 'u': elif char == 'u':
import supybot.conf as conf import supybot.conf as conf
return conf.supybot.reply.format.url() % args.pop() url = args.pop()
if url:
return conf.supybot.reply.format.url() % url
else:
return ''
elif char == 'v': elif char == 'v':
args.pop() args.pop()
return '' return ''