Helpviewer/Feeds/FeedsManager.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3002
6ffc581f00f1
child 3058
0a02c433f52d
--- a/Helpviewer/Feeds/FeedsManager.py	Tue Oct 15 22:03:54 2013 +0200
+++ b/Helpviewer/Feeds/FeedsManager.py	Fri Oct 18 23:00:41 2013 +0200
@@ -14,7 +14,8 @@
     pass
 
 from PyQt4.QtCore import pyqtSlot, pyqtSignal, Qt, QUrl, QXmlStreamReader
-from PyQt4.QtGui import QDialog, QIcon, QTreeWidgetItem, QMenu, QCursor, QApplication
+from PyQt4.QtGui import QDialog, QIcon, QTreeWidgetItem, QMenu, QCursor, \
+    QApplication
 from PyQt4.QtNetwork import QNetworkRequest, QNetworkReply
 from PyQt4.QtWebKit import QWebSettings
 
@@ -92,7 +93,8 @@
         
         # step 2: add the feed
         if icon.isNull() or \
-           icon == QIcon(QWebSettings.webGraphic(QWebSettings.DefaultFrameIconGraphic)):
+                icon == QIcon(QWebSettings.webGraphic(
+                    QWebSettings.DefaultFrameIconGraphic)):
             icon = UI.PixmapCache.getIcon("rss16.png")
         feed = (urlString, title, icon)
         self.__feeds.append(feed)
@@ -178,8 +180,9 @@
                     if feed[0] == urlString:
                         E5MessageBox.critical(self,
                             self.trUtf8("Duplicate Feed URL"),
-                            self.trUtf8("""A feed with the URL {0} exists already."""
-                                        """ Aborting...""".format(urlString)))
+                            self.trUtf8(
+                                """A feed with the URL {0} exists already."""
+                                """ Aborting...""".format(urlString)))
                         return
                 
                 self.__feeds[feedIndex] = (urlString, title, feedToChange[2])
@@ -199,8 +202,8 @@
         res = E5MessageBox.yesNo(self,
             self.trUtf8("Delete Feed"),
             self.trUtf8(
-                """<p>Do you really want to delete the feed <b>{0}</b>?</p>""".format(
-                title)))
+                """<p>Do you really want to delete the feed"""
+                """ <b>{0}</b>?</p>""".format(title)))
         if res:
             urlString = itm.data(0, FeedsManager.UrlStringRole)
             if urlString:
@@ -255,7 +258,8 @@
         
         import Helpviewer.HelpWindow
         request = QNetworkRequest(QUrl(urlString))
-        reply = Helpviewer.HelpWindow.HelpWindow.networkAccessManager().get(request)
+        reply = Helpviewer.HelpWindow.HelpWindow.networkAccessManager()\
+            .get(request)
         reply.finished[()].connect(self.__feedLoaded)
         self.__replies[id(reply)] = (reply, itm)
     
@@ -305,7 +309,8 @@
                 itm = QTreeWidgetItem(topItem)
                 itm.setText(0, self.trUtf8("Error fetching feed"))
                 itm.setData(0, FeedsManager.UrlStringRole, "")
-                itm.setData(0, FeedsManager.ErrorDataRole, str(xmlData, encoding="utf-8"))
+                itm.setData(0, FeedsManager.ErrorDataRole,
+                            str(xmlData, encoding="utf-8"))
             
             topItem.setExpanded(True)
         else:
@@ -332,8 +337,10 @@
         urlString = itm.data(0, FeedsManager.UrlStringRole)
         if urlString:
             menu = QMenu()
-            menu.addAction(self.trUtf8("&Open"), self.__openMessageInCurrentTab)
-            menu.addAction(self.trUtf8("Open in New &Tab"), self.__openMessageInNewTab)
+            menu.addAction(
+                self.trUtf8("&Open"), self.__openMessageInCurrentTab)
+            menu.addAction(
+                self.trUtf8("Open in New &Tab"), self.__openMessageInNewTab)
             menu.addSeparator()
             menu.addAction(self.trUtf8("&Copy URL to Clipboard"),
                            self.__copyUrlToClipboard)
@@ -342,7 +349,8 @@
             errorString = itm.data(0, FeedsManager.ErrorDataRole)
             if errorString:
                 menu = QMenu()
-                menu.addAction(self.trUtf8("&Show error data"), self.__showError)
+                menu.addAction(
+                    self.trUtf8("&Show error data"), self.__showError)
                 menu.exec_(QCursor.pos())
     
     def __itemActivated(self, itm, column):
@@ -356,7 +364,8 @@
             return
         
         self.__openMessage(
-            QApplication.keyboardModifiers() & Qt.ControlModifier == Qt.ControlModifier)
+            QApplication.keyboardModifiers() & 
+            Qt.ControlModifier == Qt.ControlModifier)
         
     def __openMessageInCurrentTab(self):
         """
@@ -374,7 +383,8 @@
         """
         Private method to open a feed message.
         
-        @param newTab flag indicating to open the feed message in a new tab (boolean)
+        @param newTab flag indicating to open the feed message in a new tab
+            (boolean)
         """
         itm = self.feedsTree.currentItem()
         if itm is None:

eric ide

mercurial