Commit aecde455 authored by Nicolas Dumazet's avatar Nicolas Dumazet

use enumerate


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32732 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a6915ef2
...@@ -385,8 +385,8 @@ class XMLMatrix(Folder): ...@@ -385,8 +385,8 @@ class XMLMatrix(Folder):
index_list = [] index_list = []
for index in cell_id[len(base_id)+1:].split('_'): for index in cell_id[len(base_id)+1:].split('_'):
index_list.append(int(index)) index_list.append(int(index))
for i in range(len(index_list)): for i, index in enumerate(index_list):
if index_list[i] >= size_list[i]: if index >= size_list[i]:
removed_cell_id_list.append(cell_id) removed_cell_id_list.append(cell_id)
break break
...@@ -541,9 +541,9 @@ class XMLMatrix(Folder): ...@@ -541,9 +541,9 @@ class XMLMatrix(Folder):
index = self.index[base_id] index = self.index[base_id]
cell_id_list = [base_id] cell_id_list = [base_id]
append = cell_id_list.append append = cell_id_list.append
for i in xrange(len(kw)): for i, item in enumerate(kw):
try: try:
append(str(index[i][kw[i]])) append(str(index[i][item]))
except KeyError: except KeyError:
return None return None
return '_'.join(cell_id_list) return '_'.join(cell_id_list)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment