Convert some uses of range(len(x)) to enumerate(x).
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This commit is contained in:
parent
223ed1e3d3
commit
7395798515
1 changed files with 5 additions and 5 deletions
|
|
@ -115,8 +115,8 @@ class Tabbable:
|
|||
pass
|
||||
if key in ("next-field", "previous-field"):
|
||||
item = 0
|
||||
for i in range(len(self.grid.cells)):
|
||||
if self in self.grid.cells[i].widget_list:
|
||||
for i, cell in enumerate(self.grid.cells):
|
||||
if self in cell.widget_list:
|
||||
item = i
|
||||
break
|
||||
offset = 1 if key == "next-field" else -1
|
||||
|
|
@ -204,9 +204,9 @@ class RecordFormatter:
|
|||
return []
|
||||
res = [0] * len(x[0])
|
||||
for l in x:
|
||||
for i in range(len(l)):
|
||||
if len(l[i]) > res[i]:
|
||||
res[i] = len(l[i])
|
||||
for i, li in enumerate(l):
|
||||
if len(li) > res[i]:
|
||||
res[i] = len(li)
|
||||
return res
|
||||
|
||||
def format(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue