mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 14:59:34 +01:00
Switched pgpkey from using .read() to .readline() since there's possibly a large amount of results.
This commit is contained in:
parent
b00743c242
commit
cc07bc1272
@ -394,18 +394,19 @@ class Http(callbacks.Privmsg):
|
|||||||
host = 'http://pgp.mit.edu:11371'
|
host = 'http://pgp.mit.edu:11371'
|
||||||
url = '%s/pks/lookup?op=index&search=%s' % (host, urlClean)
|
url = '%s/pks/lookup?op=index&search=%s' % (host, urlClean)
|
||||||
fd = urllib2.urlopen(url)
|
fd = urllib2.urlopen(url)
|
||||||
html = fd.read().split('\n')
|
|
||||||
fd.close()
|
|
||||||
pgpkeys = ''
|
pgpkeys = ''
|
||||||
for line in html:
|
line = fd.readline()
|
||||||
|
while len(line) != 0:
|
||||||
info = self._pgpkeyre.search(line)
|
info = self._pgpkeyre.search(line)
|
||||||
if info:
|
if info:
|
||||||
pgpkeys += '%s <%s> :: ' % (info.group(3), '%s%s' % (host,
|
pgpkeys += '%s <%s> :: ' % (info.group(3), '%s%s' % (host,
|
||||||
info.group(1)))
|
info.group(1)))
|
||||||
|
line = fd.readline()
|
||||||
if len(pgpkeys) == 0:
|
if len(pgpkeys) == 0:
|
||||||
irc.reply(msg, 'No results found for %s.' % search)
|
irc.reply(msg, 'No results found for %s.' % search)
|
||||||
else:
|
else:
|
||||||
irc.reply(msg, 'Matches found for %s: %s' % (search, pgpkeys[:-4]))
|
irc.reply(msg, 'Matches found for %s: %s' % (search, pgpkeys[:-4]))
|
||||||
|
fd.close()
|
||||||
|
|
||||||
Class = Http
|
Class = Http
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user