Converted to not care how long its messages are.

This commit is contained in:
Jeremy Fincher 2003-09-07 05:34:56 +00:00
parent 3ba5942be9
commit 3161bb5750

View File

@ -122,20 +122,19 @@ class Google(callbacks.PrivmsgCommandAndRegexp):
self.last24hours = structures.queue() self.last24hours = structures.queue()
def formatData(self, data): def formatData(self, data):
time = '(search took %s seconds)' % data.meta.searchTime time = 'Search took %s seconds: ' % data.meta.searchTime
results = [] results = []
for result in data.results: for result in data.results:
title = utils.htmlToText(result.title.encode('utf-8')) title = utils.htmlToText(result.title.encode('utf-8'))
url = result.URL url = result.URL
if title: if title:
results.append('\x02%s\x02: %s' % (title, url)) results.append('\x02%s\x02: <%s>' % (title, url))
else: else:
results.append(url) results.append(url)
if not results: if not results:
return 'No matches found %s' % time return 'No matches found %s' % time
else: else:
s = ircutils.privmsgPayload(results, ' :: ', 375) return '%s %s' % (time, '; '.join(results))
return '%s %s' % (s, time)
def googlelicensekey(self, irc, msg, args): def googlelicensekey(self, irc, msg, args):
"""<key> """<key>
@ -146,7 +145,6 @@ class Google(callbacks.PrivmsgCommandAndRegexp):
key = privmsgs.getArgs(args) key = privmsgs.getArgs(args)
google.setLicense(key) google.setLicense(key)
irc.reply(msg, conf.replySuccess) irc.reply(msg, conf.replySuccess)
googlelicensekey = privmsgs.checkCapability(googlelicensekey, 'admin') googlelicensekey = privmsgs.checkCapability(googlelicensekey, 'admin')
def google(self, irc, msg, args): def google(self, irc, msg, args):