117 data.append("{0:3.0%}".format( |
117 data.append("{0:3.0%}".format( |
118 values["comments"] / (float(values["loc"]) or 1))) |
118 values["comments"] / (float(values["loc"]) or 1))) |
119 data.append("{0:3.0%}".format( |
119 data.append("{0:3.0%}".format( |
120 values["comments"] / (float(values["sloc"]) or 1))) |
120 values["comments"] / (float(values["sloc"]) or 1))) |
121 data.append("{0:3.0%}".format( |
121 data.append("{0:3.0%}".format( |
122 (values["comments"] + values["multi"]) / |
122 (values["comments"] + values["multi"]) / |
123 (float(values["loc"]) or 1))) |
123 (float(values["loc"]) or 1))) |
124 itm = QTreeWidgetItem(self.resultList, data) |
124 itm = QTreeWidgetItem(self.resultList, data) |
125 for col in range(1, 10): |
125 for col in range(1, 10): |
126 itm.setTextAlignment(col, Qt.Alignment(Qt.AlignRight)) |
126 itm.setTextAlignment(col, Qt.Alignment(Qt.AlignRight)) |
127 |
127 |
177 |
177 |
178 @param fn file or list of files or directory to show |
178 @param fn file or list of files or directory to show |
179 the code metrics for |
179 the code metrics for |
180 @type str or list of str |
180 @type str or list of str |
181 """ |
181 """ |
|
182 self.__errorItem = None |
|
183 self.resultList.clear() |
182 self.cancelled = False |
184 self.cancelled = False |
183 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
185 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
184 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True) |
186 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True) |
185 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
187 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
186 QApplication.processEvents() |
188 QApplication.processEvents() |