Commit 4fa521b2 authored by Nicolas Dumazet's avatar Nicolas Dumazet

use iteritems


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32744 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5ffc0eda
...@@ -679,14 +679,13 @@ class XMLMatrix(Folder): ...@@ -679,14 +679,13 @@ class XMLMatrix(Folder):
# Check empty indices. # Check empty indices.
empty_list = [] empty_list = []
base_item = self.index[base_id] base_item = self.index[base_id]
for i in base_item.keys(): for key, value in base_item.iteritems()
item = base_item[i] if value is None or len(value) == 0:
if item is None or len(item) == 0:
addError("There is no id for the %dth axis of base_id %s" % (i, base_id)) addError("There is no id for the %dth axis of base_id %s" % (i, base_id))
empty_list.append(i) empty_list.append(key)
if fixit: if fixit:
for i in empty_list: for i in empty_list:
del base_item[i] del base_item[key]
len_id = len(base_item) len_id = len(base_item)
if len(object_id_split) != (len_id + base_id_len): # +1 for the quantity if len(object_id_split) != (len_id + base_id_len): # +1 for the quantity
...@@ -695,7 +694,7 @@ class XMLMatrix(Folder): ...@@ -695,7 +694,7 @@ class XMLMatrix(Folder):
to_delete_set.add(object_id) to_delete_set.add(object_id)
else : else :
for i in range(len_id): for i in range(len_id):
if int(object_id_split[i+base_id_len]) >= len(self.index[base_id][i]): if int(object_id_split[i+base_id_len]) >= len(base_item[i]):
addError("Cell %s is out of bound" % object_id) addError("Cell %s is out of bound" % object_id)
to_delete_set.add(object_id) to_delete_set.add(object_id)
......
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