Converted ShrinkUrl to use format.

This commit is contained in:
Jeremy Fincher 2005-02-01 09:41:39 +00:00
parent 74717061f2
commit 18f8044621

View File

@ -120,8 +120,7 @@ class ShrinkUrl(callbacks.PrivmsgCommandAndRegexp):
url = match.group(0) url = match.group(0)
r = self.registryValue('nonSnarfingRegexp', channel) r = self.registryValue('nonSnarfingRegexp', channel)
if r and r.search(url) is not None: if r and r.search(url) is not None:
self.log.debug('Matched nonSnarfingRegexp: %s', self.log.debug('Matched nonSnarfingRegexp: %u', url)
utils.quoted(url))
return return
minlen = self.registryValue('minimumLength', channel) minlen = self.registryValue('minimumLength', channel)
cmd = self.registryValue('default', channel) cmd = self.registryValue('default', channel)
@ -132,11 +131,10 @@ class ShrinkUrl(callbacks.PrivmsgCommandAndRegexp):
elif cmd == 'ln': elif cmd == 'ln':
(shorturl, _) = self._getLnUrl(url) (shorturl, _) = self._getLnUrl(url)
if shorturl is None: if shorturl is None:
self.log.info('Couldn\'t get shorturl for %s', self.log.info('Couldn\'t get shorturl for %u', url)
utils.quoted(url))
return return
domain = utils.web.getDomain(url) domain = utils.web.getDomain(url)
s = '%s (at %s)' % (ircutils.bold(shorturl), domain) s = format('%u (at %s)', ircutils.bold(shorturl), domain)
m = irc.reply(s, prefixName=False) m = irc.reply(s, prefixName=False)
m.tag('shrunken') m.tag('shrunken')
shrinkSnarfer = urlSnarfer(shrinkSnarfer) shrinkSnarfer = urlSnarfer(shrinkSnarfer)