mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-06 01:24:05 +01:00
Fixed bug #1020820.
This commit is contained in:
parent
3b9e141e88
commit
41117c431e
@ -33,7 +33,10 @@
|
|||||||
Provides basic functionality for handling RSS/RDF feeds.
|
Provides basic functionality for handling RSS/RDF feeds.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import supybot
|
||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
__author__ = supybot.authors.jemfinch
|
||||||
|
|
||||||
import supybot.plugins as plugins
|
import supybot.plugins as plugins
|
||||||
|
|
||||||
@ -92,7 +95,7 @@ class RSS(callbacks.Privmsg):
|
|||||||
threaded = True
|
threaded = True
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
callbacks.Privmsg.__init__(self)
|
callbacks.Privmsg.__init__(self)
|
||||||
self.feedNames = sets.Set()
|
self.feedNames = callbacks.CanonicalNameSet()
|
||||||
self.locks = {}
|
self.locks = {}
|
||||||
self.lastRequest = {}
|
self.lastRequest = {}
|
||||||
self.cachedFeeds = {}
|
self.cachedFeeds = {}
|
||||||
@ -234,8 +237,9 @@ class RSS(callbacks.Privmsg):
|
|||||||
for d in feed['items']:
|
for d in feed['items']:
|
||||||
if 'title' in d:
|
if 'title' in d:
|
||||||
title = utils.htmlToText(d['title']).strip()
|
title = utils.htmlToText(d['title']).strip()
|
||||||
if showLinks:
|
link = d.get('link')
|
||||||
headlines.append('%s <%s>' % (title, d['link']))
|
if link and showLinks:
|
||||||
|
headlines.append('%s <%s>' % (title, link))
|
||||||
else:
|
else:
|
||||||
headlines.append('%s' % title)
|
headlines.append('%s' % title)
|
||||||
return headlines
|
return headlines
|
||||||
@ -257,7 +261,7 @@ class RSS(callbacks.Privmsg):
|
|||||||
assert name == self._validFeedName(name)
|
assert name == self._validFeedName(name)
|
||||||
if url not in self.locks:
|
if url not in self.locks:
|
||||||
self.locks[url] = threading.RLock()
|
self.locks[url] = threading.RLock()
|
||||||
if hasattr(self, name):
|
if hasattr(self.__class__, name):
|
||||||
s = 'I already have a command in this plugin named %s' % name
|
s = 'I already have a command in this plugin named %s' % name
|
||||||
raise callbacks.Error, s
|
raise callbacks.Error, s
|
||||||
def f(self, irc, msg, args):
|
def f(self, irc, msg, args):
|
||||||
|
Loading…
Reference in New Issue
Block a user