import os
from os import mkdir, remove, stat, environ
from os.path import isfile, isdir, exists
+import codecs
# Comment the line below if you don't want to use OpenGL for QML rendering or if it is not supported
from PySide import QtOpenGL, QtCore
def getArticle(self, key, article):
feed = listing.getFeed(key)
try:
- file = open(feed.getContentLink(article))
+ file = codecs.open(feed.getContentLink(article), "r", "utf-8")
html = file.read().replace("body", "body bgcolor='#ffffff'", 1)
file.close()
except:
- html = "<html><body>Error retrieving article</body></html>"
+ html = u"<html><body>Error retrieving article</body></html>"
return html
@QtCore.Slot(str, result=str)
@QtCore.Slot()
def updateAll(self):
- for feed in listing.getSortedListOfKeys("Manual"):
- listing.updateFeed(feed)
-
+ for catid in listing.getListOfCategories():
+ for feed in listing.getSortedListOfKeys("Manual", category=catid):
+ listing.updateFeed(feed)
+
+ @QtCore.Slot(str)
+ def updateCategory(self, catid):
+ for feed in listing.getSortedListOfKeys("Manual", category=catid):
+ listing.updateFeed(feed)
+
@QtCore.Slot(str,str,str)
def addFeed(self, title, url, catid):
listing.addFeed(title,url, category=catid)
listing.addCategory(name)
@QtCore.Slot(str)
+ def removeFeed(self, key):
+ listing.removeFeed(key)
+
+ @QtCore.Slot(str)
+ def removeCategory(self, catid):
+ listing.removeCategory(catid)
+
+ @QtCore.Slot(str)
def markAllAsRead(self, key):
feed = listing.getFeed(key)
feed.markAllAsRead()