Add supybot.plugins.ShrinkUrl.bold

This commit is contained in:
James Vega 2005-03-09 23:29:49 +00:00
parent e3d4478d82
commit 606e92a47f
2 changed files with 7 additions and 1 deletions

View File

@ -63,6 +63,9 @@ conf.registerChannelValue(ShrinkUrl, 'outFilter',
conf.registerChannelValue(ShrinkUrl, 'default', conf.registerChannelValue(ShrinkUrl, 'default',
ShrinkService('ln', """Determines what website the bot will use when ShrinkService('ln', """Determines what website the bot will use when
shrinking a URL.""")) shrinking a URL."""))
conf.registerGlobalValue(ShrinkUrl, 'bold',
registry.Boolean(True, """Determines whether this plugin will bold certain
portions of its replies."""))
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78 # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78

View File

@ -133,7 +133,10 @@ class ShrinkUrl(callbacks.PluginRegexp):
self.log.info('Couldn\'t get shorturl for %u', url) self.log.info('Couldn\'t get shorturl for %u', url)
return return
domain = utils.web.getDomain(url) domain = utils.web.getDomain(url)
s = format('%u (at %s)', ircutils.bold(shorturl), domain) if self.registryValue('bold'):
s = format('%u (at %s)', ircutils.bold(shorturl), domain)
else:
s = format('%u (at %s)', 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)