90 |
90 |
91 @param pair pair of integers |
91 @param pair pair of integers |
92 """ |
92 """ |
93 start, end = pair |
93 start, end = pair |
94 if start == end: |
94 if start == end: |
95 return "%d" % start |
95 return "{0:d}".format(start) |
96 else: |
96 else: |
97 return "%d-%d" % (start, end) |
97 return "{0:d}-{1:d}".format(start, end) |
98 |
98 |
99 return ", ".join(map(stringify, pairs)) |
99 return ", ".join(map(stringify, pairs)) |
100 |
100 |
101 def __createResultItem(self, file, statements, executed, coverage, excluded, missing): |
101 def __createResultItem(self, file, statements, executed, coverage, excluded, missing): |
102 """ |
102 """ |
111 """ |
111 """ |
112 itm = QTreeWidgetItem(self.resultList, [ |
112 itm = QTreeWidgetItem(self.resultList, [ |
113 file, |
113 file, |
114 str(statements), |
114 str(statements), |
115 str(executed), |
115 str(executed), |
116 "%d%%" % coverage, |
116 "{0:d}%".format(coverage), |
117 excluded, |
117 excluded, |
118 missing |
118 missing |
119 ]) |
119 ]) |
120 for col in range(1, 4): |
120 for col in range(1, 4): |
121 itm.setTextAlignment(col, Qt.AlignRight) |
121 itm.setTextAlignment(col, Qt.AlignRight) |
131 self.__cfn = cfn |
131 self.__cfn = cfn |
132 self.__fn = fn |
132 self.__fn = fn |
133 |
133 |
134 self.basename = os.path.splitext(cfn)[0] |
134 self.basename = os.path.splitext(cfn)[0] |
135 |
135 |
136 self.cfn = "%s.coverage" % self.basename |
136 self.cfn = "{0}.coverage".format(self.basename) |
137 |
137 |
138 if isinstance(fn, list): |
138 if isinstance(fn, list): |
139 files = fn |
139 files = fn |
140 self.path = os.path.dirname(cfn) |
140 self.path = os.path.dirname(cfn) |
141 elif os.path.isdir(fn): |
141 elif os.path.isdir(fn): |
202 else: |
202 else: |
203 pc = 100.0 |
203 pc = 100.0 |
204 itm = QTreeWidgetItem(self.summaryList, [ |
204 itm = QTreeWidgetItem(self.summaryList, [ |
205 str(total_statements), |
205 str(total_statements), |
206 str(total_executed), |
206 str(total_executed), |
207 "%d%%" % pc |
207 "{0:d}%".format(pc) |
208 ]) |
208 ]) |
209 for col in range(0, 3): |
209 for col in range(0, 3): |
210 itm.setTextAlignment(col, Qt.AlignRight) |
210 itm.setTextAlignment(col, Qt.AlignRight) |
211 |
211 |
212 self.__finish() |
212 self.__finish() |