Merge lp:~toni-ruottu/kunquat/fixenums into lp:kunquat/0.2

Proposed by Toni Ruottu
Status: Merged
Merged at revision: 324
Proposed branch: lp:~toni-ruottu/kunquat/fixenums
Merge into: lp:kunquat/0.2
Diff against target: 87 lines (+6/-30)
4 files modified
kunquat/qt/typewriter.py (+2/-8)
kunquat/qt/typewriter_model.py (+2/-8)
kunquat/qt/typewriter_view.py (+1/-7)
kunquat/tracker/toolbar.py (+1/-7)
To merge this branch: bzr merge lp:~toni-ruottu/kunquat/fixenums
Reviewer Review Type Date Requested Status
Tomi Jylhä-Ollila Pending
Review via email: mp+132743@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'kunquat/qt/typewriter.py'
2--- kunquat/qt/typewriter.py 2012-08-28 20:56:55 +0000
3+++ kunquat/qt/typewriter.py 2012-11-02 19:42:20 +0000
4@@ -74,18 +74,12 @@
5 def get_view(self):
6 return self._twview
7
8- def all_ints(self):
9- i = 0
10- while True:
11- yield i
12- i += 1
13-
14 def get_keymap(self):
15 return dict(self.keymap_helper(self.keys))
16
17 def keymap_helper(self, mapping):
18- for row, buttons in zip(self.all_ints(), mapping):
19- for but, key in zip(self.all_ints(), buttons):
20+ for row, buttons in enumerate(mapping):
21+ for but, key in enumerate(buttons):
22 yield (key, (row, but))
23
24 def count_rows(self):
25
26=== modified file 'kunquat/qt/typewriter_model.py'
27--- kunquat/qt/typewriter_model.py 2012-08-29 06:16:41 +0000
28+++ kunquat/qt/typewriter_model.py 2012-11-02 19:42:20 +0000
29@@ -18,15 +18,9 @@
30 self._dice = [unichr(i) for i in dice_code]
31 self._die = self._dice[4]
32
33- def all_ints(self):
34- i = 0
35- while True:
36- yield i
37- i += 1
38-
39 def notemap_helper(self, mapping):
40- for row, buttons in zip(self.all_ints(), mapping):
41- for but, note in zip(self.all_ints(), buttons):
42+ for row, buttons in enumerate(mapping):
43+ for but, note in enumerate(buttons):
44 yield ((row, but), note)
45
46 def get_notemap(self):
47
48=== modified file 'kunquat/qt/typewriter_view.py'
49--- kunquat/qt/typewriter_view.py 2012-09-22 18:39:57 +0000
50+++ kunquat/qt/typewriter_view.py 2012-11-02 19:42:20 +0000
51@@ -28,14 +28,8 @@
52 # Reserving 0 pixels does not work properly
53 self.setMinimumHeight(1)
54
55- def all_ints(self):
56- i = 0
57- while True:
58- yield i
59- i += 1
60-
61 def create_rows(self, button_layout):
62- for (i, buttons) in zip(self.all_ints(), button_layout):
63+ for (i, buttons) in enumerate(button_layout):
64 yield self.create_row(i, buttons)
65
66 def special_button(self, rowc):
67
68=== modified file 'kunquat/tracker/toolbar.py'
69--- kunquat/tracker/toolbar.py 2012-09-23 15:39:15 +0000
70+++ kunquat/tracker/toolbar.py 2012-11-02 19:42:20 +0000
71@@ -174,16 +174,10 @@
72 index = self._scale_selector.findText(s)
73 self._scale_selector.setCurrentIndex(index)
74
75- def all_ints(self):
76- i = 0
77- while True:
78- yield i
79- i += 1
80-
81 def update_scales(self):
82 current = 0
83
84- for i, s in zip(self.all_ints(), self.p._scales):
85+ for i, s in enumerate(self.p._scales):
86 if s == self.p._scale:
87 current = i
88

Subscribers

People subscribed via source and target branches

to all changes: