DataViews/CodeMetricsDialog.py

changeset 2986
cd4e2cab7eb2
parent 2302
f29e9405c851
child 3021
801289962f4e
child 3057
10516539f238
diff -r 177b1858245f -r cd4e2cab7eb2 DataViews/CodeMetricsDialog.py
--- a/DataViews/CodeMetricsDialog.py	Fri Oct 04 17:48:17 2013 +0200
+++ b/DataViews/CodeMetricsDialog.py	Sun Oct 06 17:27:53 2013 +0200
@@ -11,8 +11,8 @@
 import fnmatch
 
 from PyQt4.QtCore import pyqtSlot, Qt, QLocale, qVersion
-from PyQt4.QtGui import QDialog, QDialogButtonBox, QMenu, QHeaderView, QTreeWidgetItem, \
-    QApplication
+from PyQt4.QtGui import QDialog, QDialogButtonBox, QMenu, QHeaderView, \
+    QTreeWidgetItem, QApplication
 
 from .Ui_CodeMetricsDialog import Ui_CodeMetricsDialog
 from . import CodeMetrics
@@ -36,7 +36,8 @@
         self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
         self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
         
-        self.summaryList.headerItem().setText(self.summaryList.columnCount(), "")
+        self.summaryList.headerItem().setText(
+            self.summaryList.columnCount(), "")
         self.summaryList.header().resizeSection(0, 200)
         self.summaryList.header().resizeSection(1, 100)
         
@@ -45,10 +46,12 @@
         self.cancelled = False
         
         self.__menu = QMenu(self)
-        self.__menu.addAction(self.trUtf8("Collapse all"), self.__resultCollapse)
+        self.__menu.addAction(self.trUtf8("Collapse all"),
+                              self.__resultCollapse)
         self.__menu.addAction(self.trUtf8("Expand all"), self.__resultExpand)
         self.resultList.setContextMenuPolicy(Qt.CustomContextMenu)
-        self.resultList.customContextMenuRequested.connect(self.__showContextMenu)
+        self.resultList.customContextMenuRequested.connect(
+            self.__showContextMenu)
         
         self.__fileList = []
         self.__project = None
@@ -182,10 +185,14 @@
         # now do the summary stuff
         docstrings = total['lines'] - total['comments'] - \
                      total['empty lines'] - total['non-commentary lines']
-        self.__createSummaryItem(self.trUtf8("files"), loc.toString(total['files']))
-        self.__createSummaryItem(self.trUtf8("lines"), loc.toString(total['lines']))
-        self.__createSummaryItem(self.trUtf8("bytes"), loc.toString(total['bytes']))
-        self.__createSummaryItem(self.trUtf8("comments"), loc.toString(total['comments']))
+        self.__createSummaryItem(self.trUtf8("files"),
+                                 loc.toString(total['files']))
+        self.__createSummaryItem(self.trUtf8("lines"),
+                                 loc.toString(total['lines']))
+        self.__createSummaryItem(self.trUtf8("bytes"),
+                                 loc.toString(total['bytes']))
+        self.__createSummaryItem(self.trUtf8("comments"),
+                                 loc.toString(total['comments']))
         self.__createSummaryItem(self.trUtf8("empty lines"),
                                  loc.toString(total['empty lines']))
         self.__createSummaryItem(self.trUtf8("non-commentary lines"),
@@ -215,7 +222,8 @@
         
     def __finish(self):
         """
-        Private slot called when the action finished or the user pressed the button.
+        Private slot called when the action finished or the user pressed the
+        button.
         """
         self.cancelled = True
         self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)
@@ -223,8 +231,10 @@
         self.buttonBox.button(QDialogButtonBox.Close).setDefault(True)
         
         if qVersion() >= "5.0.0":
-            self.resultList.header().setSectionResizeMode(QHeaderView.Interactive)
-            self.summaryList.header().setSectionResizeMode(QHeaderView.Interactive)
+            self.resultList.header().setSectionResizeMode(
+                QHeaderView.Interactive)
+            self.summaryList.header().setSectionResizeMode(
+                QHeaderView.Interactive)
         else:
             self.resultList.header().setResizeMode(QHeaderView.Interactive)
             self.summaryList.header().setResizeMode(QHeaderView.Interactive)
@@ -251,12 +261,13 @@
         if "ExcludeFiles" not in self.__data or \
            filterString != self.__data["ExcludeFiles"]:
             self.__data["ExcludeFiles"] = filterString
-            self.__project.setData("OTHERTOOLSPARMS", "CodeMetrics", self.__data)
+            self.__project.setData("OTHERTOOLSPARMS", "CodeMetrics",
+                                   self.__data)
         filterList = filterString.split(",")
         if filterList:
             for filter in filterList:
-                fileList = \
-                    [f for f in fileList if not fnmatch.fnmatch(f, filter.strip())]
+                fileList = [f for f in fileList 
+                            if not fnmatch.fnmatch(f, filter.strip())]
         
         self.resultList.clear()
         self.summaryList.clear()

eric ide

mercurial