|
48 | 48 | import sys
|
49 | 49 | import traceback
|
50 | 50 |
|
51 |
| -VERSION = '1.0' |
| 51 | +VERSION = '1.1' |
52 | 52 |
|
53 | 53 |
|
54 | 54 | class GitChart:
|
@@ -103,12 +103,14 @@ def _git_command(self, command1, command2=None):
|
103 | 103 | p2 = subprocess.Popen(command2, stdin=p1.stdout,
|
104 | 104 | stdout=subprocess.PIPE)
|
105 | 105 | p1.stdout.close()
|
106 |
| - return p2.communicate()[0].decode('utf-8', errors='ignore').strip().split('\n') |
| 106 | + return p2.communicate()[0].decode('utf-8', errors='ignore') \ |
| 107 | + .strip().split('\n') |
107 | 108 | else:
|
108 | 109 | # execute a single git cmd and return output
|
109 | 110 | p = subprocess.Popen(command1, stdout=subprocess.PIPE,
|
110 | 111 | cwd=self.repository)
|
111 |
| - return p.communicate()[0].decode('utf-8', errors='ignore').strip().split('\n') |
| 112 | + return p.communicate()[0].decode('utf-8', errors='ignore') \ |
| 113 | + .strip().split('\n') |
112 | 114 |
|
113 | 115 | def _generate_bar_chart(self, data, sorted_keys=None, max_keys=0,
|
114 | 116 | max_x_labels=0, x_label_rotation=0):
|
@@ -139,7 +141,7 @@ def _generate_bar_chart(self, data, sorted_keys=None, max_keys=0,
|
139 | 141 | if count % n != 0:
|
140 | 142 | bar_chart.x_labels[i] = ''
|
141 | 143 | count += 1
|
142 |
| - bar_chart.add('', [data[n] for n in sorted_keys]) |
| 144 | + bar_chart.add('', [data[k] for k in sorted_keys]) |
143 | 145 | self._render(bar_chart)
|
144 | 146 |
|
145 | 147 | def _chart_authors(self):
|
@@ -190,7 +192,7 @@ def _chart_commits_hour_week(self):
|
190 | 192 | commits[wday[:-1]][hour.split(':')[0]] += 1
|
191 | 193 | dot_chart = pygal.Dot(style=self.style)
|
192 | 194 | dot_chart.title = self.title
|
193 |
| - dot_chart.x_labels = ['{0:02d}'.format(hour) for hour in range(0, 24)] |
| 195 | + dot_chart.x_labels = ['{0:02d}'.format(hh) for hh in range(0, 24)] |
194 | 196 | for day in self.weekdays:
|
195 | 197 | dot_chart.add(day, commits[day])
|
196 | 198 | self._render(dot_chart)
|
|
0 commit comments