mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +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
|
# Unicode check
|
||||||
self.assertNotError('google ae')
|
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):
|
def testSearchOneToOne(self):
|
||||||
self.assertRegexp('google dupa', ';')
|
self.assertRegexp('google dupa', ';')
|
||||||
self.assertNotError('config plugins.Google.oneToOne True')
|
self.assertNotError('config plugins.Google.oneToOne True')
|
||||||
|
@ -314,6 +314,8 @@ for (name, s) in registry._cache.iteritems():
|
|||||||
registerGroup(supybot, 'reply')
|
registerGroup(supybot, 'reply')
|
||||||
|
|
||||||
registerGroup(supybot.reply, 'format')
|
registerGroup(supybot.reply, 'format')
|
||||||
|
registerChannelValue(supybot.reply.format, 'url',
|
||||||
|
registry.String('<%s>', _("""Determines how urls should be formatted.""")))
|
||||||
registerChannelValue(supybot.reply.format, 'time',
|
registerChannelValue(supybot.reply.format, 'time',
|
||||||
registry.String('%I:%M %p, %B %d, %Y', _("""Determines how timestamps
|
registry.String('%I:%M %p, %B %d, %Y', _("""Determines how timestamps
|
||||||
printed for human reading should be formatted. Refer to the Python
|
printed for human reading should be formatted. Refer to the Python
|
||||||
|
@ -471,7 +471,8 @@ def format(s, *args, **kwargs):
|
|||||||
elif char == 't':
|
elif char == 't':
|
||||||
return timestamp(args.pop())
|
return timestamp(args.pop())
|
||||||
elif char == 'u':
|
elif char == 'u':
|
||||||
return '<%s>' % args.pop()
|
import supybot.conf as conf
|
||||||
|
return conf.supybot.reply.format.url() % args.pop()
|
||||||
elif char == 'v':
|
elif char == 'v':
|
||||||
args.pop()
|
args.pop()
|
||||||
return ''
|
return ''
|
||||||
|
Loading…
Reference in New Issue
Block a user