mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-14 14:49:21 +01:00
Add configuration variable supybot.reply.format.url.
This commit is contained in:
parent
60cba105c8
commit
ef78c86974
@ -54,6 +54,12 @@ class GoogleTestCase(ChannelPluginTestCase):
|
||||
# Unicode check
|
||||
self.assertNotError('google ae')
|
||||
|
||||
def testSearchFormat(self):
|
||||
self.assertRegexp('google foo', '<http://.*>')
|
||||
self.assertNotError('config reply.format.url %s')
|
||||
self.assertRegexp('google foo', 'http://.*')
|
||||
self.assertNotRegexp('google foo', '<http://.*>')
|
||||
|
||||
def testSearchOneToOne(self):
|
||||
self.assertRegexp('google dupa', ';')
|
||||
self.assertNotError('config plugins.Google.oneToOne True')
|
||||
|
@ -314,6 +314,8 @@ for (name, s) in registry._cache.iteritems():
|
||||
registerGroup(supybot, 'reply')
|
||||
|
||||
registerGroup(supybot.reply, 'format')
|
||||
registerChannelValue(supybot.reply.format, 'url',
|
||||
registry.String('<%s>', _("""Determines how urls should be formatted.""")))
|
||||
registerChannelValue(supybot.reply.format, 'time',
|
||||
registry.String('%I:%M %p, %B %d, %Y', _("""Determines how timestamps
|
||||
printed for human reading should be formatted. Refer to the Python
|
||||
|
@ -471,7 +471,8 @@ def format(s, *args, **kwargs):
|
||||
elif char == 't':
|
||||
return timestamp(args.pop())
|
||||
elif char == 'u':
|
||||
return '<%s>' % args.pop()
|
||||
import supybot.conf as conf
|
||||
return conf.supybot.reply.format.url() % args.pop()
|
||||
elif char == 'v':
|
||||
args.pop()
|
||||
return ''
|
||||
|
Loading…
Reference in New Issue
Block a user