Skip to content

Commit de5358d

Browse files
committed
Fix some PEP8/pyflakes warnings
1 parent 38a8f11 commit de5358d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

gitchart.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
import sys
4949
import traceback
5050

51-
VERSION = '1.0'
51+
VERSION = '1.1'
5252

5353

5454
class GitChart:
@@ -103,12 +103,14 @@ def _git_command(self, command1, command2=None):
103103
p2 = subprocess.Popen(command2, stdin=p1.stdout,
104104
stdout=subprocess.PIPE)
105105
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')
107108
else:
108109
# execute a single git cmd and return output
109110
p = subprocess.Popen(command1, stdout=subprocess.PIPE,
110111
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')
112114

113115
def _generate_bar_chart(self, data, sorted_keys=None, max_keys=0,
114116
max_x_labels=0, x_label_rotation=0):
@@ -139,7 +141,7 @@ def _generate_bar_chart(self, data, sorted_keys=None, max_keys=0,
139141
if count % n != 0:
140142
bar_chart.x_labels[i] = ''
141143
count += 1
142-
bar_chart.add('', [data[n] for n in sorted_keys])
144+
bar_chart.add('', [data[k] for k in sorted_keys])
143145
self._render(bar_chart)
144146

145147
def _chart_authors(self):
@@ -190,7 +192,7 @@ def _chart_commits_hour_week(self):
190192
commits[wday[:-1]][hour.split(':')[0]] += 1
191193
dot_chart = pygal.Dot(style=self.style)
192194
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)]
194196
for day in self.weekdays:
195197
dot_chart.add(day, commits[day])
196198
self._render(dot_chart)

0 commit comments

Comments
 (0)