comparison backend/AbstractFeedUpdater.py @ 242:03e3ebb1d52f

Disable the use of a proxy when updating feeds - https traffic does not seem to work currently over a proxy.
author Dirk Olmes <dirk@xanthippe.ping.de>
date Mon, 08 Jun 2015 19:20:46 +0200
parents e34c53a3e407
children 51d2c3d55f4b
comparison
equal deleted inserted replaced
241:e0e7459556bc 242:03e3ebb1d52f
23 result = self._retrieveFeed() 23 result = self._retrieveFeed()
24 self._setFeedTitle(result) 24 self._setFeedTitle(result)
25 self._processEntries(result) 25 self._processEntries(result)
26 26
27 def _retrieveFeed(self): 27 def _retrieveFeed(self):
28 if self.preferences.isProxyConfigured(): 28 # Retrieving https connections over a proxy does not seem to work currently
29 proxyUrl = "http://%s:%i" % (self.preferences.proxyHost(), self.preferences.proxyPort()) 29 #if self.preferences.isProxyConfigured():
30 proxyHandler = ProxyHandler({"http": proxyUrl}) 30 # proxyUrl = '{0}:{1}'.format(self.preferences.proxyHost(), self.preferences.proxyPort())
31 result = feedparser.parse(self.feed.rss_url, handlers=[proxyHandler]) 31 # proxyHandler = ProxyHandler({'http': proxyUrl, 'https': proxyUrl})
32 else: 32 # result = feedparser.parse(self.feed.rss_url, handlers=[proxyHandler])
33 # when updating to python3 see http://code.google.com/p/feedparser/issues/detail?id=260 33 #else:
34 result = feedparser.parse(self.feed.rss_url) 34 # # when updating to python3 see http://code.google.com/p/feedparser/issues/detail?id=260
35 result = feedparser.parse(self.feed.rss_url)
36 print(result)
35 # bozo flags if a feed is well-formed. 37 # bozo flags if a feed is well-formed.
36 # if result["bozo"] > 0: 38 # if result["bozo"] > 0:
37 # raise FeedUpdateException() 39 # raise FeedUpdateException()
38 status = result["status"] 40 status = result["status"]
39 if status >= STATUS_ERROR: 41 if status >= STATUS_ERROR: